Visual Basic Customization

Visual Basic Customization

Reply
Member
5 Posts
0 Kudos
Registered: ‎05-22-2014
Post 1 of 2
Accepted Solution

Right click Run-Time Error

111 Views, 1 Replies
06-01-2014 02:24 AM

Hello, I made a macro to pick multiple points, the problem is if I right click in the moment when I have to pick a point it gives me a run-time error and stops at this line:

varPnt = ThisDrawing.Utility.GetPoint(, "Punct de preluat: ")

The macro works if I normaly click (left click), but if I right click by mistake I run into this problem and I would like to prevent this.

Hi,

 

you can set the statement before your GetPoint call:

   On Error Resume Next

and after the line with GetPoint evaluate Err.Number or Err.Description to see what type of error occured.

 

To finish that type of error handling (ignoring the error and resume with the next line) use this line:

   On Error Goto 0

 

HTH, - alfred -

*Expert Elite*
9,836 Posts
1,219 Kudos
Registered: ‎06-29-2007
Post 2 of 2

Re: Right click Run-Time Error

06-01-2014 12:10 PM in reply to: catalin91ch

Hi,

 

you can set the statement before your GetPoint call:

   On Error Resume Next

and after the line with GetPoint evaluate Err.Number or Err.Description to see what type of error occured.

 

To finish that type of error handling (ignoring the error and resume with the next line) use this line:

   On Error Goto 0

 

HTH, - alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!