pizarro 发表于 2022-7-5 13:20:36

指定材质

一些lisp可以自动和随机地将材质指定给不同的3D元素。

BIGAL 发表于 2022-7-5 13:33:23

我对3d做的不多,但提供的信息很少。
 
对象类型
材料清单5、7、25?
 

pizarro 发表于 2022-7-5 13:34:43

三维图元是实体。

maratovich 发表于 2022-7-5 13:42:48

你的最终目标是什么?

pizarro 发表于 2022-7-5 13:53:11

1.-通过颜色区分不同的固体。
2.-将其导出到Autodesk Inventor时,它们保留指定材料的颜色。
 
非常感谢您的关注。

pizarro 发表于 2022-7-5 13:57:23

另一种选择是为每个层指定材质
 

maratovich 发表于 2022-7-5 14:03:57

为什么是这种材料?也许你需要换一下颜色?

pizarro 发表于 2022-7-5 14:10:04

导出时,Autodesk inventor不会识别颜色,而是识别材质。

maratovich 发表于 2022-7-5 14:16:02

 
 
 
我们需要一份所有可能材料的清单。
 
 

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

pizarro 发表于 2022-7-5 14:22:07

建议列表如下:

木材
混凝土


青铜
不锈钢
铸造厂
塑料
玻璃
页: [1]
查看完整版本: 指定材质