pizarro Posted September 14, 2018 Posted September 14, 2018 some lisp to assign materials to different 3D elements automatically and randomly. Quote
BIGAL Posted September 14, 2018 Posted September 14, 2018 I dont do much with 3d but way to little information provided. Object types List of materials 5, 7, 25 ? Quote
maratovich Posted September 14, 2018 Posted September 14, 2018 49 minutes ago, pizarro said: Elements 3D are solids. what is your ultimate goal? Quote
pizarro Posted September 14, 2018 Author Posted September 14, 2018 1.- Differentiate by colors the different solids. 2.- When exporting them to Autodesk Inventor they keep the color of the material assigned. Thank you very much for you attention. Quote
pizarro Posted September 14, 2018 Author Posted September 14, 2018 Another option would be to assign materials for each layer Quote
maratovich Posted September 14, 2018 Posted September 14, 2018 Why the material? Maybe you need to change the color? Quote
pizarro Posted September 14, 2018 Author Posted September 14, 2018 What happens is that when exporting them, Autodesk inventor does not recognize the colors but the materials. Quote
maratovich Posted September 14, 2018 Posted September 14, 2018 23 minutes ago, pizarro said: What happens is that when exporting them, Autodesk inventor does not recognize the colors but the materials. We need a list of all possible materials. 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 "The Bamboo material Exists" count = count + 1 Exit For End If Next If (count < 1) Then ThisDrawing.Materials.Add ("Bamboo") End If MsgBox "Done" End Sub Quote
pizarro Posted September 14, 2018 Author Posted September 14, 2018 The suggested list is the following: Steel Wood Concrete Aluminum Copper Bronze Stainless steel Foundry Plastic Glass... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.