Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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?

Posted

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?

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...