LastPick, LastPoint

#1
Does IntelliCAD VBA have a LastPick and/or a LastPoint function that will return the last point or object picked from a GetEntity or GetPoint usage?

Lisp has the capability, also from the command line one can use the "@" symbol to use the last point picked. Anything like this in VBA, or another way of accomplishing it other than to call a Lisp command??

Any help would be greatly appreciated,

Scott

#2
Scott,

Try

Dim myLastPoint As Point
Set myLastPoint = IntelliCAD.ActiveDocument.GetVariable("LastPoint")
MsgBox myLastPoint.x & vbCr & myLastPoint.y & vbCr & myLastPoint.z


------------------
Regards
John Finlay

#3
Thank you John it works, I forget about the ICAD variables.

Now, how would I go about, if possible, passing this LastPoint to GetSubEntity without having to pick this point in the GetSubEntity command (bypass the user action)?? Or is there another way to get the same information that the GetSubEntity command supplies??

Thank you,

Scott

#4
Scott,

The Getxxx methods are specifically designed for user interaction and pause for user selection. A PickPoint is returned as the point the user selected.

Could you please provide further explanation because I am not sure what you need?


------------------
Regards
John Finlay

#5
Scott,

On second thought I think you may be looking for selection sets using the SelectAtPoint method. You can provide the LastPoint to this method.


------------------
Regards
John Finlay

#6
John,
Thank you for the reply.

Here is what I am trying to do. This is related to another thread about freezing xref layers, I want to be able to freeze a layer of a picked entity no matter what layer it is on even if it is on an xref layer.

Some of the code is as follows:

docCur.Utility.GetEntity entgen, ptP, "ok"
'If the the picked entity is an xref I can only get the entitytype (useful information)then:

Select Case entgen.EntityType
Case 16 'Test for Xref
Set xref = entgen
docCur.Utility.GetSubEntity subent, ptP, m, cd, "" 'From this I can get xref name, picked xref entity layer, etc.

End Select


As can be seen above in order to get xref subentity info I have to know it is an xref or pick again. If it is an xref the "@" or last point picked can be entered and the GetSubEntity will accept the previous entity picked from the GetEntity instruction. This is all fine except I only want to pick once or do one action. I know this can be done in lisp, can it be done in VBA??

Am I missing something?

Thank you for your help,

Scott