Different materials for different block references to the same block definition

Different materials for different block references to the same block definition

Anonymous
Not applicable
884 Views
3 Replies
Message 1 of 4

Different materials for different block references to the same block definition

Anonymous
Not applicable

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.

0 Likes
885 Views
3 Replies
Replies (3)
Message 2 of 4

fenton_webb
Autodesk
Autodesk

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

0 Likes
Message 3 of 4

Anonymous
Not applicable

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

0 Likes
Message 4 of 4

Balaji_Ram
Alumni
Alumni

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

0 Likes