指定材质
一些lisp可以自动和随机地将材质指定给不同的3D元素。 我对3d做的不多,但提供的信息很少。对象类型
材料清单5、7、25?
三维图元是实体。 你的最终目标是什么? 1.-通过颜色区分不同的固体。
2.-将其导出到Autodesk Inventor时,它们保留指定材料的颜色。
非常感谢您的关注。 另一种选择是为每个层指定材质
为什么是这种材料?也许你需要换一下颜色? 导出时,Autodesk inventor不会识别颜色,而是识别材质。
我们需要一份所有可能材料的清单。
Option Explicit
Public Sub test()
Dim mat As AcadMaterial
Dim matName As String
For Each mat In ThisDrawing.Materials
''MsgBox mat.Name
If UCase(mat.Name) = "SITEWORK.PLANTING.GRASS.SHORT" Then
matName = mat.Name
Exit For
End If
Next
If Len(matName) > 0 Then
Dim ent As AcadEntity
For Each ent In ThisDrawing.ModelSpace
If TypeOf ent Is AcadSolid Then
ent.Material = matName
End If
Next
End If
End Sub
Sub AddMaterialToLibrary()
' This example finds the name of the block associated with a layout.
Dim material As acadMaterial
Dim count As Integer
count = 0
For Each material In ThisDrawing.Materials
If (StrComp(material.Name, "Bamboo", vbTextCompare) = 0) Then
MsgBox "TheBamboomaterial Exists"
count = count + 1
Exit For
End If
Next
If (count < 1) Then
ThisDrawing.Materials.Add ("Bamboo")
End If
MsgBox "Done"
End Sub 建议列表如下:
钢
木材
混凝土
铝
铜
青铜
不锈钢
铸造厂
塑料
玻璃
页:
[1]