Jump to content

Change colors or layers based on materials..


Recommended Posts

Posted

Hello

 

I'm looking for a way to change the colors of an object based on the objects material. What I've learned is that the objects (or enteties? I mean mesh/solid/face or similar) consists of colors, materials and textures.

 

If every mesh had its color I would run this script I've found called COL2LAY which puts everything on different layers based on their indexcolor.

 

The reason for this is that I need texturize everything in a another Autocad application called Novapoint, and this texturizing is based on layers (I know it sounds inconvinient, it is!)

 

I'm importing skp files from google warehouse with the autodesk plug-in "skp-import" and my dwg-models have material and texture, but everything is on layer 0 and color white or bylayer..

 

What makes it more difficult is that parts of the object have material "byblock"..

 

I really apprieciate help! Sorry for my awkward english:oops:

 

:)

Posted

Welcome to Cad Tutor.

 

Each entity with a material applied to it would have a 347 DXF code. This contains the ename referring to the material record in the materials dictionary. So you can then use the 1 dxf code to get that material's name. From there it's much the same as the col2lay function.

 

About the byblock material, that's a near impossible "fix". What happens if there are 2 copies of the same block, but different materials? You'd need to explode the blocks and apply the material individually to each.

Posted

Thank you for replying. I found another way around this. I export the dwg to FBX and import the FBX back into dwg. Then every mesh with material will have a color which looks similar to the material. Meshes with material byblock also seems to be dissolved into seperate colors, each color similar to the material.

Posted

That does seem a lot simpler yes. I was looking for something older (i.e. export to 3DS) which had similar functionality, but it seems ACad 2013 can't export to 3DS any-more.

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