Valued Contributor
Posts: 60
Registered: ‎06-18-2009
Message 1 of 2 (253 Views)

Get Position/Location of nested entity

253 Views, 1 Replies
04-16-2012 10:43 AM

I am trying to get either location, insertionpoint, or center of an entity that is inside of a block. I'm getting subentity using the Editor.GetNestedEntity. I create a FullSubEntityPath for highlighting, that works well, and I have looked at using GetSubEntityGeometricExtents using that same subentitypath, but not having any luck, I can't seem to find any documentation on using that method.


Am I missing some very simple approach? I know I can get the location of the owner, then calculate the location of the entity based off of that, but I'm looking for an easy way now, if that don't work out, I can do the lengthy approach.




Valued Contributor
Posts: 60
Registered: ‎06-18-2009
Message 2 of 2 (239 Views)

Re: Get Position/Location of nested entity

04-16-2012 12:40 PM in reply to: ViktorCAD

Well, I didn't find the easy answer but the other alternative is to use the .TransformBy for the points, pretty easy too. If anyone cares to know more, here's what i do in my case:


1. Select SubEntity

2. Get the block its in by using the .GetContainers on the PromptForNexstedEntity. (You'd have to iterate through all the blocks)

3. Do transformBy on the SubEntity insertionpoint/location/position with BlockTransform of its parent block.



You are not logged in.

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

Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

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

Ask the Community