.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Different materials for different block references to the same block definition

3 REPLIES 3
Reply
Message 1 of 4
Skarafaz
429 Views, 3 Replies

Different materials for different block references to the same block definition

Hi guys!

 

My .NET plugin builds block definitions containing entities imported from external dwg files and places references to them in the current drawing. Quite often, more than a reference to the same block definition is placed. Each reference represents the same object, but with different material choices for the components (3D solids) that constitute the object.

 

Is it possible to vary the rendered materials of different references to the same block definition? I'm new to AutoCad, so I really don't know if it is possible to achieve this behavior.

3 REPLIES 3
Message 2 of 4
fenton.webb
in reply to: Skarafaz

Sure. The blockReference is an object container for a BlockTableRecord. The BlockTableRecord can contain many different entities, and therefore can have multiple rendered materials on each




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 4
Skarafaz
in reply to: fenton.webb

This is a very good news! could you give me an example please? It would save my life 🙂

Message 4 of 4
Balaji_Ram
in reply to: Skarafaz

Hi,

 

For the block reference to show the assigned material, ensure that the entity in the block table record has its material set to "ByBlock". I have attached a sample drawing that assigns different materials to the block references all created from the same block.

 

If the Block Table Record has been created that way, setting the material for the block reference using code is simply assigning a material id.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost