Visual Basic Customization

Visual Basic Customization

Reply
Member
catalin91ch
Posts: 5
Registered: ‎05-22-2014
Message 1 of 2 (109 Views)
Accepted Solution

Right click Run-Time Error

109 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*
Alfred.NESWADBA
Posts: 9,583
Registered: ‎06-29-2007
Message 2 of 2 (95 Views)

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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.