pasobcosmic.blogg.se

Autocad lisp getint loop and validate
Autocad lisp getint loop and validate









autocad lisp getint loop and validate
  1. Autocad lisp getint loop and validate how to#
  2. Autocad lisp getint loop and validate code#

You currently prompt the user for both a rotation angle, and offset for the text label you're adding following pile selection, but you're not doing anything with them yet ( I get you needed help with that part more on that below). While it is necessary to define the space Object parameter for the vla-AddMText Method, this only need be done once ( prior to the While loop), instead of each time a pile selection is made ( inside the While loop).

Autocad lisp getint loop and validate code#

As written, if the user hits escape for one of the prompts, the next prompt is still evaluated, let alone the code that is dependent on the prompt results. I don't have this object enabler, so the piles do not show properly for me, but there are a few things that you may be able to do to improve your code, for example:īy wrapping all your prompts for user input in an And expression ( as the test expression for an If statement) you require all input to be valid ( non- Nil) in order to evaluate the rest of your code. Also, please feel free to comment if you have suggestions for best practices, as I'm new at this. I'm prepared to work through the rest of these aspects myself, but I would really appreciate the help on inserting the Mtext. This information would be displayed in the Mtext, and the insertion point of the text would be X offset (picked by the user) from the centre snap of the pile. My ultimate goal would be to have a tool that allows a user to enter the plant design area prefix, starting number, text angle and text offset once at the beginning, and then allow them to pick any number of piles and have the pile number increment.

Autocad lisp getint loop and validate how to#

I have figured out how to set the "PosNumber" property on the pile to whatever the user has entered, but I'm kind of stuck as to how to place an Mtext object that contains that information. The piles that we have are created in Bentley ProStructures, so they are not AutoCAD objects. I probably decided to tackle something way too complicated for one of my first lisps.











Autocad lisp getint loop and validate