pizarro Posted September 14, 2018 Share Posted September 14, 2018 some lisp to assign materials to different 3D elements automatically and randomly. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 14, 2018 Share 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 Link to comment Share on other sites More sharing options...
pizarro Posted September 14, 2018 Author Share Posted September 14, 2018 Elements 3D are solids. Quote Link to comment Share on other sites More sharing options...
maratovich Posted September 14, 2018 Share Posted September 14, 2018 49 minutes ago, pizarro said: Elements 3D are solids. what is your ultimate goal? Quote Link to comment Share on other sites More sharing options...
pizarro Posted September 14, 2018 Author Share 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 Link to comment Share on other sites More sharing options...
pizarro Posted September 14, 2018 Author Share Posted September 14, 2018 Another option would be to assign materials for each layer Quote Link to comment Share on other sites More sharing options...
maratovich Posted September 14, 2018 Share Posted September 14, 2018 Why the material? Maybe you need to change the color? Quote Link to comment Share on other sites More sharing options...
pizarro Posted September 14, 2018 Author Share Posted September 14, 2018 What happens is that when exporting them, Autodesk inventor does not recognize the colors but the materials. Quote Link to comment Share on other sites More sharing options...
maratovich Posted September 14, 2018 Share 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 Link to comment Share on other sites More sharing options...
pizarro Posted September 14, 2018 Author Share Posted September 14, 2018 The suggested list is the following: Steel Wood Concrete Aluminum Copper Bronze Stainless steel Foundry Plastic Glass... Quote Link to comment Share on other sites More sharing options...
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.