.NET

Reply
Active Member
Skarafaz
Posts: 7
Registered: ‎07-25-2013
Message 1 of 4 (176 Views)

Different materials for different block references to the same block definition

176 Views, 3 Replies
07-25-2013 03:00 AM

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.

ADN Support Specialist
fenton.webb
Posts: 352
Registered: ‎07-24-2007
Message 2 of 4 (143 Views)

Re: Different materials for different block references to the same block definit

07-25-2013 02:49 PM 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

Developer Technical Services

Autodesk Developer Network


Active Member
Skarafaz
Posts: 7
Registered: ‎07-25-2013
Message 3 of 4 (123 Views)

Re: Different materials for different block references to the same block definit

07-28-2013 08:33 AM in reply to: fenton.webb

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

ADN Support Specialist
Balaji_Ram
Posts: 660
Registered: ‎03-21-2011
Message 4 of 4 (89 Views)

Re: Different materials for different block references to the same block definit

07-30-2013 04:08 AM 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community