jan_ek Posted October 7, 2015 Share Posted October 7, 2015 Hello Can you help me create features that adds material. I would only set four parameters: Name:Test1 Diffuse:Inherit Ambient:Inherit Transparency:20 Other parameters as 0 or inactive. Preferably with the use of entmake Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted October 7, 2015 Share Posted October 7, 2015 I suppose it could be done. I've never attempted this before though http://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-DXF/files/GUID-E540C5BB-E166-44FA-B36C-5C739878B272-htm.html Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted October 7, 2015 Share Posted October 7, 2015 Just a quick run of code here. A mix of AutoLisp and VisualLisp (setq acadapp (vlax-get-acad-object));Get the Acad App (setq adoc (vlax-get-property acadapp 'ActiveDocument));Get the ActiveDocument (setq mats (vlax-get-property adoc 'Materials));Get the Materials Collection (setq mymat (vlax-invoke-method mats 'Add "Test1"));Add a New Material (setq d (dictsearch (namedobjdict) "ACAD_MATERIAL"));Get the Material Dictionary (setq mymatent (cdr (cadr (member (cons 3 "Test1") d))));Get your new Material Entity Name (setq entd (entget mymatent));Get the Enity Data of your new Material Use the link that Lt. Dan's Legs has provided for you to entmod your material. I hope this helps! regards, Hippe013 Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted October 8, 2015 Share Posted October 8, 2015 just a note hippe013, cdadr equals the same results as (cdr (cadr and you could've also used (dictsearch (cdar (dictsearch (namedobjdict) "ACAD_MATERIAL")) "Test1") That would return the same result as entd Quote Link to comment Share on other sites More sharing options...
Hippe013 Posted October 8, 2015 Share Posted October 8, 2015 just a note hippe013' date=' [b']cdadr[/b] equals the same results as (cdr (cadr and you could've also used (dictsearch (cdar (dictsearch (namedobjdict) "ACAD_MATERIAL")) "Test1") That would return the same result as entd Thanks for the tip! Quote Link to comment Share on other sites More sharing options...
jan_ek Posted October 10, 2015 Author Share Posted October 10, 2015 Thank you for your help. The material was able to create. I have one more question: 1. I've created a solid 2. Change the material on BYBlock 3. One change material, but only on one surface solid (for example "Ble1") Is there a way to restore all of the surface of a single material? Quote Link to comment Share on other sites More sharing options...
bcdrane42 Posted November 23, 2015 Share Posted November 23, 2015 I also want to do what the OP was trying to do. My problem is with altering the transparency of the material. There is no material group code for material transparency in the link Lt Dan's Legs left. In the materials editor there is the ability to alter the transparency of any material though. How could altering the transparency of the material be done via vlisp? 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.