Block-Functions (Select, Explode, etc.)

Block-Functions (Select, Explode, etc.)

Anonymous
Not applicable
9,026 Views
22 Replies
Message 1 of 23

Block-Functions (Select, Explode, etc.)

Anonymous
Not applicable

Hi community!

 

I have a C#-WPF-Application. In this application there is a list of blocks in my drawing. When I click one of these blocks in the listbox I have several button-functions. 

 

One of them:

Select the in the list selected block in the drawing.

 

Another:

Explode the in the list selected block.

 

I found several topics with Selection, but none of them worked for me. I'm looking for a selection via ObjectId or blockname of a single block, in the most cases the selectionfilter needs an array(?). 

And I'm absolutly helpless with block-explosion. Smiley Sad

 

I'm really new to Autocad and C#-Addin-programming. Smiley Indifferent

 

Thank you in advance!

Greets

Klaus

0 Likes
Accepted solutions (1)
9,027 Views
22 Replies
Replies (22)
Message 21 of 23

Anonymous
Not applicable

So Copy+Paste of a blocktablerecord only creates a new instance of this blocktablerecord (called blockreference)?

 

That means if I paste my beautiful traffic sign 3 times, I have one blocktablerecord and 3 blockreferences on it?

 

Uuuh, I hope my examiners don't ask bad questions! Smiley LOL 

 

Greets

Klaus

0 Likes
Message 22 of 23

chiefbraincloud
Collaborator
Collaborator

That is essentially correct.

 

I would say, you are not Copy/Pasting a BlockTableRecord.

 

You start out with a BlockTableRecord, which is essentially data only.  It is not visible on screen, and it is not selectable.

 

You INSERT (Hence the DXF code "INSERT" that you use in the selection filter) a Reference to that BlockTableRecord, Hence BlockReference.

 

Then you copy that BlockReference and Paste more BlockReferences, all of which point to the same BlockTableRecord.

 

If you've only had a short crash course on AutoCAD, then I'm guessing your exam must be programming related not AutoCAD related, right?  In which case I would expect your exam questions to be related more to programming and not AutoCAD.

Dave O.                                                                  Sig-Logos32.png
Message 23 of 23

Anonymous
Not applicable

My examiners don't know anything about AutoCAD, it is the programming part which is important. And because of that, I have to do a lot more exception handling, they understand such things. Smiley Very Happy work for tomorrow... Smiley Wink

 

Thank you for the great support! 

 

Greets

Klaus

0 Likes