📄 rhinoceros
字号:
''' ------------------------------------------------------------
''' RhinoScript 3.0 Sample Code
''' 2002, Robert McNeel & Associates
'''
''' CurrentModelInfo.rvb
''' ------------------------------------------------------------
Option Explicit
''' ------------------------------------------------------------
''' Subroutine: CurrentModelInfo
''' Purpose: Displays information about the currently
''' loaded Rhino document.
''' ------------------------------------------------------------
Sub CurrentModelInfo()
Dim strName, strPath, strFilespec
Dim objFSO, objFile
strName = Rhino.DocumentName()
strPath = Rhino.DocumentPath()
strFilespec = strPath & strName
Set objFSO = CreateObject("Scripting.FileSystemObject")
If (objFSO.FileExists(strFilespec)) Then
Set objFile = objFSO.GetFile(strFilespec)
PrintFileInformation(objFile)
Else
Rhino.Print "Current model not found. Make sure the model has been saved to disk."
End If
End Sub
''' ------------------------------------------------------------
''' Subroutine: PrintFileInformation
''' Purpose: Displays a file's information.
''' ------------------------------------------------------------
Sub PrintFileInformation (objFile)
Dim str
str = "Full Path: " & objFile.Path & vbCrLf
str = str & "File Name: " & objFile.Name & vbCrLf
str = str & "File Type: " & objFile.Type & vbCrLf
str = str & "File Attributes: " & FileAttributes(objFile) & vbCrLf
str = str & "Date Created: " & objFile.DateCreated & vbCrLf
str = str & "Last Date Accessed: " & objFile.DateLastAccessed & vbCrLf
str = str & "Last Date Modified: " & objFile.DateLastModified & vbCrLf
str = str & "File Size (Bytes): " & objFile.Size & vbCrLf
Rhino.MessageBox str,,"Current Model Information"
End Sub
''' ------------------------------------------------------------
''' Subroutine: FileAttributes
''' Purpose: Returns a string containing file attributes.
''' ------------------------------------------------------------
Function FileAttributes (objFile)
Dim str
If objFile.Attributes and 0 Then
str = "Normal"
Else
If objFile.Attributes and 1 Then str = str & "Directory "
If objFile.Attributes and 2 Then str = str & "Read-Only "
If objFile.Attributes and 4 Then str = str & "Hidden "
If objFile.Attributes and 8 Then str = str & "System "
If objFile.Attributes and 16 Then str = str & "Volume "
If objFile.Attributes and 32 Then str = str & "Archive "
If objFile.Attributes and 64 Then str = str & "Alias "
If objFile.Attributes and 128 Then str = str & "Compressed "
End If
FileAttributes = str
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -