.NET

Reply
*James Allen
Message 1 of 6 (285 Views)

Select Nested

285 Views, 5 Replies
08-16-2007 05:08 AM
Can .Net 1) select multiple nested entities 2) within the same block reference 3) in one crossing window action? If
so would you please give me a nudge in the right direction?

I am totally new to C# and .Net and don't have any prior experience with ObjectArx either. I have gotten as far as
the attached code, but it will only select one nested entity per crossing window per block reference. If with a
single crossing window I cross two or more nested entities in a block/xref I want them all to be selected. For
example, the built in Trim/Extend commands work as I'm trying to get this to.

Thank you,
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO
*James Allen
Message 2 of 6 (285 Views)

Re: Select Nested

08-20-2007 01:46 PM in reply to: *James Allen
I found this 3 year old post stating that there is nothing built in for this even in native arx.
http://discussion.autodesk.com/thread.jspa?messageID=3967495
I've been searching high and low and can't find anything for it, managed or otherwise. That's very disappointing.
It seems to me like they would have made this available by now.

I'm considering other alternatives now and will post back if I come up with anything I think is worthwhile.

James


"James Allen" wrote in message news:5691593@discussion.autodesk.com...
Can .Net 1) select multiple nested entities 2) within the same block reference 3) in one crossing window action? If
so would you please give me a nudge in the right direction?

I am totally new to C# and .Net and don't have any prior experience with ObjectArx either. I have gotten as far as
the attached code, but it will only select one nested entity per crossing window per block reference. If with a
single crossing window I cross two or more nested entities in a block/xref I
want them all to be selected. For
example, the built in Trim/Extend commands work as I'm trying to get this to.

Thank you,
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO
Distinguished Contributor
Luis Esquivel
Posts: 445
Registered: ‎12-02-2004
Message 3 of 6 (285 Views)

Re: Select Nested

08-21-2007 11:23 AM in reply to: *James Allen
James;

I did a quick test in objectarx and it provides the same as in c#... and then did also some code in c# to emulate what the command trim does.

Sorry no code available, but this is what I did and just for blocks no xrefs and as an exercise and appears to work just fine:

1. Select the blocks that are in the screen view and make a deep nest explode of them and save the exploded entities ids inside of an ObjectIdCollection and add the temporary entities to the drawing and the blocks ids in another one - making sure to hide them via: block.Visible = false.

2. Then, in your command just have your nest blocks explode function before making a selection, that will generate the blocks items as normal entities, then make your selection and do your stuff and verify if your ids collections are not empty and erase the temporary entities and turn on the visible mode of the blocks.

HTH.
*James Allen
Message 4 of 6 (285 Views)

Re: Select Nested

08-22-2007 04:55 AM in reply to: *James Allen
Hi Luis,

Thank you. I'm currently thinking along different lines (though not getting much time to put on it). I would need
this to work with xrefs and am afraid that something involving explode may be too much for xrefs or large selection
areas. I haven't ruled it out but am pursuing other possibilities first.
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO


wrote in message news:5696545@discussion.autodesk.com...
James;

I did a quick test in objectarx and it provides the same as in c#... and then did also some code in c# to emulate
what the command trim does.

Sorry no code available, but this is what I did and just for blocks no xrefs and as an exercise and appears to work
just fine:

1. Select the blocks that are in the screen view and make a deep nest explode of them and save the exploded entities
ids inside of an ObjectIdCollection and add the temporary entities to the drawing and the blocks ids in another
one - making sure to hide them via: block.Visible = false.

2. Then, in your command just have your nest blocks explode function before making a selection, that will generate
the blocks items as normal entities, then make your selection and do your stuff and verify if your ids collections
are not empty and erase the temporary entities and turn on the visible mode of the blocks.

HTH.
Distinguished Contributor
Luis Esquivel
Posts: 445
Registered: ‎12-02-2004
Message 5 of 6 (285 Views)

Re: Select Nested

08-22-2007 08:04 AM in reply to: *James Allen
/*Thank you. I'm currently thinking along different lines (though not getting much time to put on it). I would need
this to work with xrefs and am afraid that something involving explode may be too much for xrefs or large selection
areas. I haven't ruled it out but am pursuing other possibilities first.*/

James;

If you want to run your own tests with the functions I wrote, I can e-mail them to you.

Running the tests on simple blocks (using a large number on the screen view), it works very fast.

I will try to add the xrefs, and see how that might work - I might need something like this.
*James Allen
Message 6 of 6 (285 Views)

Re: Select Nested

08-23-2007 04:57 AM in reply to: *James Allen
I would like to test your functions, but not until I have my own working. I've gotten far enough with mine that I
really want to follow through with it to see how it works out, even if it turns out to not be as effective or
efficient as yours. As I mentioned I'm new to .Net, and this is proving to be a very educational exercise.

I look forward to seeing how they compare. My address is in the header; just change the obvious.
--
James Allen
Malicoat-Winslow Engineers, P.C.
Columbia, MO


wrote in message news:5697474@discussion.autodesk.com...
/*Thank you. I'm currently thinking along different lines (though not getting much time to put on it). I would need
this to work with xrefs and am afraid that something involving explode may be too much for xrefs or large selection
areas. I haven't ruled it out but am pursuing other possibilities first.*/

James;

If you want to run your own tests with the functions I wrote, I can e-mail them to you.

Running the tests on simple blocks (using a large number on the screen view), it works very fast.

I will try to add the xrefs, and see how that might work - I might need something like this.

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