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

Exploding a nested block and keeping the exploded parts selected

9 REPLIES 9
Reply
Message 1 of 10
HEnnulat
1948 Views, 9 Replies

Exploding a nested block and keeping the exploded parts selected

When exploding a nested block that was just inserted into the drawing. Is there a way to programmatically select all the exploded components? The purpose in my case is to locate a nested block and to modify the associateed attribute references.
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: HEnnulat

I don't see what point there is to exploding a block to change the
attributes of a nested block insertion.

The purpose of putting one block insertion inside the definition of another
'parent' block is to have all insertions of the parent block show the same
data (including values of attributes of nested blocks).

You can't have different values for attributes of a nested block, in each
insertion of the parent block, and this seems to be the source of your
confusion.


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6286671@discussion.autodesk.com...
When exploding a nested block that was just inserted into the drawing. Is
there a way to programmatically select all the exploded components? The
purpose in my case is to locate a nested block and to modify the associateed
attribute references.
Message 3 of 10
HEnnulat
in reply to: HEnnulat

Tony,

It is confusing. However I had a nice long conversation with Jerry Winters who basically wrote the code I was looking for. I will be posting this code shortly as a reply to my original post in the "Working With Nested Blocks" discussion.

My purpose of putting block insertions inside of a parent block is to make it easier to insert the parent block with all the inserted blocks positioned correctly in the parent block (relative to the parent) with one insertion command. Also the parent block is one that is being created according to my specifications whereas the nested blocks are client blocks that I'm not sure will always have the same insertion points.

Ultimately I need to explode the parent block anyway, as it wouldn't meet the client format. The solution that Jerry came up with was to locate the nested blocks prior to exploding the parent (using the insertion points of both the nested and parent blocks and summing these together using a Transform method), exploding the parent, and then locating the formerly nested block just based on their location (insertion point), and changing the attributes. In this way the attributes for each instance (or reference) of the remaining block (or blocks) can all be unique.

It was all clear to me at the time, but based on your comments here I see I wasn't clear enough.
Message 4 of 10
Anonymous
in reply to: HEnnulat

If the parent block is just a container for inserting multiple objects and
is going to be exploded anyway, that's another matter and no, you didn't
make that clear earlier.

What puzzles me is the approach you cite to do it, because it makes no
sense. When you explode something, you can get the resulting objects very
easily, but perhaps Jerrry doesn't know how to do that.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6288237@discussion.autodesk.com...
Tony,

It is confusing. However I had a nice long conversation with Jerry Winters
who basically wrote the code I was looking for. I will be posting this code
shortly as a reply to my original post in the Nested Blocks discussion.

The purpose of putting block insertions inside of a parent block is to make
it easier to insert the parent block with all the inserted blocks positioned
correctly in the parent block (relative to the parent) with one insertion
command. Also the parent block is one that is being created according to my
specifications whereas the nested blocks are client blocks that I'm not sure
will always have the same insertion points.

Ultimately I need to explode the parent block anyway, as it wouldn't meet
the client format. The solution that Jerry came up with was to locate the
nested blocks prior to exploding the parent (using the insertion points of
both the nested and parent blocks and summing these together using a
Transform method), exploding the parent, and then locating the formerly
nested block, and changing the attributes. In this way the attributes for
each instance (or reference) of the remaining block (or blocks) can all be
unique.

It was all clear to me at the time, but based on your comments here I see I
wasn't clear enough.

Edited by: HEnnulat on Nov 12, 2009 3:52 PM
Message 5 of 10
HEnnulat
in reply to: HEnnulat

From your post: "When you explode something, you can get the resulting objects very easily"

How? What is the concept and methods employed to do this?

I found that nothing is selected after exploding so there is not way to include what was just exploded in some kind of selection set.

I thought Jerry's code was Genius actually. It didn't take very many lines to figure out the locations of the nested blocks and then find them.

Edited by: HEnnulat on Nov 12, 2009 4:16 PM Edited by: HEnnulat on Nov 12, 2009 4:18 PM
Message 6 of 10
Anonymous
in reply to: HEnnulat

It depends on how you are exploding the block.

Via the API, or via the command line?

If you are exploding it via the API as you should be, the resulting
objects are added to a DBObjectCollection that you pass in to the
Explode() method, and you must append them to the owner space
yourself (which is trivial).

If you are exploding the objects via the EXPLODE command,
the resulting objects become the "Previous" selection set which
can be gotten via the Editor's SelectPrevious() method.

Considering those things, the approach you describe to find
the exploded objects is what we might call ''the scenic route".

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6288249@discussion.autodesk.com...
From your post: "When you explode something, you can get the resulting
objects very easily"

How? What is the concept and methods employed to do this?

I found that nothing is selected after exploding so there is not way to
include what was just exploded in some kind of selection set.

I thought Jerry's code was Genius actually. It didn't take very many lines
to figure out the locations of the nested blocks and then find them.

Edited by: HEnnulat on Nov 12, 2009 4:16 PM

Edited by: HEnnulat on Nov 12, 2009 4:18 PM
Message 7 of 10
HEnnulat
in reply to: HEnnulat

That sounds good. Thanks.

And yes, it is programmatically inserted and exploded.
Message 8 of 10
saeed2006
in reply to: HEnnulat

do know how explode a text to line and arcs?
Message 9 of 10
HEnnulat
in reply to: HEnnulat

I am not aware that text can be exploded into lines and arcs. I do not believe this can be done. I only know that "blocks" can be exploded.
Message 10 of 10
travis
in reply to: HEnnulat

You can explode text to line entities using the Express Tools.

 

To find out if your release has them, type "expresstools" at the command prompt and it will autoload.  If it loads, there is an option under Express -> Text -> Explode Text.

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