Hi everyone,
I am stuck something with get Entity.
3 element array Pt always turned with zero values what ever I select.
here is my code please help...
Solved! Go to Solution.
Solved by bojko108. Go to Solution.
Must be a variant type
it is from the help of vba in acad :
Dim returnObj As AcadObject
Dim basePnt As Variant
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
yes it is
I know that and I applied basepoint as variant
nothing change my friend.
I get basepoint matrix empty.
I need solution.
hi. have you
Dim oEnt As AcadEntity >>> change for AcadObject
not working ?
Or check the point of this entity with the baee property of autocad. it is the same?
If your entity picked is (0,0) so is good
thanks for quick responding
yes i changed like you say
as variant i can get a matrix with empty values
as double i can get 0 matrix
i do not understand if i get 0 matrices is good please explain that.
This works for me, it return not 0 but actually values at the clicked location. Even if you declare object as AcadEntity or AcadObject
Dim returnObj As AcadObject
Dim basePnt As Variant
ThisDrawing.Utility.GetEntity returnObj, basePnt, "Select an object"
MsgBox basePnt(0) & vbNewLine & _
basePnt(1) & vbNewLine & _
basePnt(2)
Why you need this information. Your variable Pt will contain coordinates of the crosshair at the time of selection not coordinates of the object that you pick. You can use object.Coordinates method for coordinates of the object.
I need both coordinates of objet and the pick point
I use it for a long polyline that I want to take the slopes between specific vertices.
Designers must decide which vertices are suitable or best fit.
For this reason, I need that a specific point without coordinates of the object with one click.
I use both coordinates and pick point.
Anyway it is my solution to solve the problem and it works.
But any shorter and easier suggestions acceptable.
Thanks again.