Hello, I have a macro that picks points, in the userform I placed a command button thats executes that function, the problem is after I pick the point it moves me to the previous poisition of the userfrom when I clicked the command.
I have to move in the model space and I want keep the position while I am picking points.
Hi,
can you show the code where you start the pick multiple points?
Did you hide the form in the meantime, was it modal or not, ... all information necessary to help.
- alfred -
This is the code (same for the post before), removed the cases:
Public Sub cmdPreia_Click() Dim ok As Integer Dim varPnt As Variant frmInterfata.Hide varPnt = ThisDrawing.Utility.GetPoint(, MsjP) X = varPnt(0) Y = varPnt(1) Z = varPnt(2) Select Case cMsj End Select frmInterfata.show False End Sub
Hi,
>> the problem is after I pick the point it moves me to the previous poisition of the userfrom
Maybe I misunderstand something, your code asks for one point and then it shows the form. That is how you created your code (hide the form - pick the point - show the form), what is the problem then?
- alfred -
Yes hide the form - pick the point - show the form, the problem is it hides the form then I need to pick the point but I move in the model space for example to find the desired point to pick but after I click it the userform appears but in the model space the position where I picked point doesn't remain, it moves me in the model space in the location where I was before I click the command button, I want to remain in the position where I picked the point in the model space.
Hi,
so you mean you do some PAN and ZOOM while you are in GetPoint-mode, then you left-click to get the point, that brings you back to the form and AutoCAD itself restores the view that was active before your PAN and ZOOM?
Then sorry to say, I can't reproduce that.
What AutoCAD version/service pack/if vertical which one are you using.
- alfred -
Hi,
sorry, I can't reproduce it with 2013 too (tried it first with 2015).
I attached a mini-sample (no errorhandling or comments), load it, start it with VBARUN ==> StartForm and let's know if my code works or show the same issues.
Maybe a search for the current servicepack could help too?
- alfred -
Can't find what you're looking for? Ask the community or share your knowledge.