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

Get Position/Location of nested entity

3 REPLIES 3
Reply
Message 1 of 4
ViktorCAD
1127 Views, 3 Replies

Get Position/Location of nested entity

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.

 

Thanks,

Viktor.

3 REPLIES 3
Message 2 of 4
ViktorCAD
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.

 

 

Message 3 of 4
e2962812
in reply to: ViktorCAD

I am trying to get the insertion point of a nested block reference. Would you care to share your code?

Message 4 of 4
_gile
in reply to: e2962812

Hi,

 

You should give more information about the way you get the nested block reference or post the code you've written so far.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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