Jump to content
Apache2k

LISP Materials (textures, shaders)

Recommended Posts

Apache2k

I have been trying to find some sources how to handle materials via LISP but it seems to be impossible to get anything out.

 

Is it so that Lisp cant handle the material library?

 

I have a custom material library containing materials that i want to attach to the selected block. Not to layer.

 

vla-put-material seems to be an option but don't know how to use it.

 

Any help is welcome.

Share this post


Link to post
Share on other sites
Tharwat

Hi,

 

The materials that is inserted into current drawing as a collection :

 

(vla-get-materials (vla-get-activedocument (vlax-get-acad-object)))

 

and to assign materials to 3D objects, the material object name should be an item in the collection to be able to add it to any object with the function:

 

(vla-put-material <vla-object> <Name_of_material>)

 

I didn't work with materials with Lisp before but with some tests I come up with the above.

Share this post


Link to post
Share on other sites
Apache2k

Thank you Tharwat, but i have to say that i still don't get this :) :) To i have to move my custom material from my material library first to the document material library? and can dis be done via LISP or VLA?

Share this post


Link to post
Share on other sites
Tharwat

I think yes it is possible and we can try that since we would loss nothing :)

We can create a temporary 3D object and assign the materials that you want to use to it , then delete the temporary object so the materials would be available in current drawing.

 

Upload a few material to see the type of these files.

 

What do you think?

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...