GetEntity and GetObject methods

GetEntity and GetObject methods

Anonymous
Not applicable
253 Views
3 Replies
Message 1 of 4

GetEntity and GetObject methods

Anonymous
Not applicable
Here is a simple question.. Once I've selected an entity using GetEntity and GetObject, how do I determine what type of element I have whether it is an arc, line, spline, etc..? I'm looking to somehow filter the elements after it's been selected without using the selection sets methods. Is there a way? I would like to pass the entity to different areas in my code after I've determined what type of element the user has selected. Any help would be appreciated.
0 Likes
254 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Dim Entity As AcadEntity
Dim PickPt As Variant
ThisDrawing.Utility.GetEntity Entity, PickPt

Select Case Entity.EntityName
Case "AcDbLine"
Utility.Prompt "This is a line"
Case "AcDbCircle"
Utility.Prompt "This is a circle"
Case "AcDbArc"
Utility.Prompt "This is an arc"
.....
End Select



"Narith" wrote in message
news:f09fd58.-1@WebX.maYIadrTaRb...
> Here is a simple question.. Once I've selected an entity using GetEntity
and GetObject, how do I determine what type of element I have whether it is
an arc, line, spline, etc..? I'm looking to somehow filter the elements
after it's been selected without using the selection sets methods. Is there
a way? I would like to pass the entity to different areas in my code after
I've determined what type of element the user has selected. Any help would
be appreciated.
>
0 Likes
Message 3 of 4

Anonymous
Not applicable
If your filtering structure isn't to complicated, you could us the
If...Then...Else statement TypeOf keyword.

If TypeOf oEnt Is AcadText Then

--
Bobby C. Jones
http://www.acadx.com
0 Likes
Message 4 of 4

Anonymous
Not applicable
Thanks Tony,

I appreciate the help. I tried the routine and I am having trouble using the properties of the objects. It seems that the objects that are passed with this routine doesn't allow me to use the properties because it doesn't recognize the objects' properties. For example, after selecting the object, I was unable to access and compare the objects' x,y,c location. Have you experienced this problem before? Is there another routine that allows me to choose the entity and access it's properties as well?

Narith
0 Likes