ObjectARX .net attrubutes copy

ObjectARX .net attrubutes copy

prachipatil1801
Explorer Explorer
266 Views
1 Reply
Message 1 of 2

ObjectARX .net attrubutes copy

prachipatil1801
Explorer
Explorer

I am working on generating drawing in Autocad electrical using  ObjectARX using C#.net . I am replicating symbols , Terminal and  wires. As per attached diagram I am replicating line number 3 to line number 7 , but facing issues setting up the attributes using attsync command from .net. Can some one please guide me auto generating Terminal Number , Device Number and Wire Numbers using C#.net and ObjectARX. Any guidance is appreciated.

0 Likes
267 Views
1 Reply
Reply (1)
Message 2 of 2

norman.yuan
Mentor
Mentor

Firstly, posting the same question with different title as the attempt to get responses isn't a good approach. You should consider how to make your question make sense for other to respond, for example, showing your relevant code to demonstrate what "replicating" means.

 

From the picture you attached and since you mention "attributes", it seems to me that you are to insert an array of block references, and then you want to set the values of the attributes of the block references. It also seems to me that you might not understand block definition/block reference and attribute definition/attribute references well, because you mention "attribute copy" and mention using "attsync" command (it is probably useless here).

 

The code could be rather simple:

 

For each circuit, if it is a block,

1. Create a BlockReference;

2. Create AttributeRefences of the BlockReference, based on the block definition (BlockTableRecord), with desired values.

The repeat it to create next circuit (above, or below) until it is done.

 

Creating/inserting block reference with attributes is one of the most common .NET API coding topics and you can find code samples here or online easily. If you do run into issues with actual block inserting code, showing it here would be much easier for others to read and comment.

 

 

Norman Yuan

Drive CAD With Code

EESignature