AutoCAD Visual LISP / AutoLISP :: Getstring Input Integer Or Distance?

Feb 21, 2013

I would like to eliminate a mouse click in my program. I use getstring to allow the user to either enter in an integer or a distance used for labeling in a drawing, but I could eliminate the need for the user to then click an option that completes the label if I only knew how to determine if the entry is an integer (such as 5 or 15) or a distance (such as 24" or 36").

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Default Text For Getstring?

Nov 8, 2012

How to do a default text for getstring?  I would use initget in the following except the prefix can be any letter(s). And the problem with what I have below is it does not type the default text if nothing is entered.

(defun C:ww ()
(if tmp (= nil) (setq tmp "ABC"))
(prompt "
Enter prefix <")(princ tmp)(princ ">: ")
(setq pfix (strcase (getstring)))
(if (= pfix nil) (setq pfix tmp))
(setq tmp pfix)
(setq PT (getpoint "
Pick point: "))
(command "TEXT" "S" "Standard" "J" "M" PT "6" "0" pfix)
)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Put Default Text On Command Line For Getstring

Jun 6, 2012

I am trying to get a default value (from global variable) put as the default for getstring command. Problem is I want it as if I had typed it into the getstring command so I can modify it if required. It is for entering filenames which only change slightly ie 1129E09LS1 ...LS2 ...XS1 etc.

Current
(setq BlkName (getstring "
Enter Civil Cad File to Import: "))
For defaults that I don't want to change I usually use this format:
(or BlkName (setq BlkName (getstring "
Enter Civil Cad File to Import: ")))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Getstring / Getint Digits / Characters Entry Limit?

Aug 26, 2013

I have been searching all over and have not found a method for limiting the number of digits/characters a user can enter for a getstring or getint prompt.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Polygon From Distance Between Point

Sep 18, 2013

I need a lisp that creates a polygon of N points, so to enter a only the distance between these points, after choosing N points in the drawing for approximately creating polygons.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Use User-input As Block Name?

Sep 5, 2012

I just need the userinput to be incorporated in the insert command but don't know how to segregate the block name from the block path..

;;;PROMPT USER FOR BLOCK NAME HERE
(setq userinBLKNAME (getstring "
Please type in the block name shown in the allrevblocks - ex: IFCC4:"))

;;;INSERT BLOCK BASED ON BLOCK NAME PROVIDED HERE
(command "-insert" "B:\CAD\REVBLOCKS\IFC\"USERINBLKNAME PAUSE "1" "" "")

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Append To User Input

May 7, 2012

I've been trying to append a user input by adding this text "ABC" to the front of it.  How can I do that?

(setq NUMX (getstring "
Please specify NUMBER:")); INPUT NUMBER 123 HERE
(SETQ NUMXX (append '(ABC) NUMX))

So that NUMXX now equals ABC123.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pausing To Allow User Input?

Dec 14, 2013

I want to write a very simple AutoLISP program to scale selected objects by a factor of (1/25.4).  How to I get the program to pause and allow the user to select the base point?  I know that "~" will bring up a selection window, but what is the character that will allow point selection (in this context)?  While we're at it, what is the operator that would trigger a pause and allow user command line input? 

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Distance Between Two Points Along The Path Of Polyline

Sep 10, 2012

There are times that I have a really long curb polyline that has both line and arc segments.  I wish to pick two points along that polyline and have it give me the distance between those two points along the path of the polyline.

Do we have this ability natively?  Have I been missing something all this time?  Normally I have to make a copy of the original entity, ... break, break, list erase or undo....

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Error - Extra Right Paren On Input

Jun 18, 2013

In my acaddoc.lsp I have it load an autoload.lsp file that contains many lisp routines (attached). I am getting the "extra right paren on input" error. It appears to error after the third line in the autoload file "san18"....I removed everything after the third line and no error, I put them back and it errors and only loads first three?

I am using Civil 3D 2014 and I have added all neccesary paths to the trusted locations.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Automated Drawing Using Input Data?

Jul 4, 2013

I would like to automate drawing process for certain data. Using some LISP codes User will be asked to provide some data and using that data an automatic drawing needed to be developed at Drawing editor of AutoCAD. For example;

Enter the width of Sheet: 50 mm
enter the length of Sheet: 200 mm
Enter the sheet thickness: 5mm
Enter type of feed: Automatic
Are there holes in Strip: Yes/No
Specify nu of holes: 5
Position of holes Centre: 5,5
Distance between the holes:  At an interval of 20mm each

I just need a LISP code for such program.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Alert Box That Takes User Input?

Jul 30, 2012

Is there a way to have an alert box pop up at a certain point in the code which gives the user a chance to cancel the LISP program and not proceed any further?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Maintain View Distance When Changing Viewpoint?

Dec 30, 2011

I am using the following routine definition then calling the different view poins from a pop up menu.

Each time I switch veiw points it drastically zooms out. I would like to maintain the "zoom distance" if there is such a thing when switching views. 

Ideally, like when in 3dorbit, I would like it to swing views around similar to that but to the defined viewpoints as below....

(DEFUN V (inp) (setq inp (strcase inp))

   (cond     ((= inp "T")       (SETQ IXY 270)       (SETQ FXY 90))     ((= INP "F")       (SETQ IXY 270)       (SETQ FXY 0))     ((= INP "RE")       (SETQ IXY 90)       (SETQ FXY 0))     ((= INP "L")       (SETQ IXY 180)       (SETQ FXY 0))     ((= INP "RI")       (SETQ IXY 0)       (SETQ FXY 0))     ((= INP "URI")       (SETQ IXY 0)       (SETQ FXY 45))     ((= INP "UL")       (SETQ IXY 180)       (SETQ FXY 45))     ((= INP "UF")       (SETQ IXY 270)       (SETQ FXY 45))     ((= INP "URE")       (SETQ IXY 90)       (SETQ FXY 45))     ((= INP "URF")       (SETQ IXY 315)       (SETQ FXY 35))     ((= INP "URR")       (SETQ IXY 45)       (SETQ FXY 35))     ((= INP "ULF")       (SETQ IXY 225)       (SETQ FXY 35))     ((= INP "ULR")       (SETQ IXY 135)       (SETQ FXY 35))   );COND  (COMMAND "VPOINT" "R" IXY FXY) );END V.LSP

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Find Maximum Distance Between 3D Poly And Spline?

Aug 8, 2013

Let's say I have a 3D polyline, which I turn into a spline. I then want to determine how closely the original polyline and spline follow each other. How I can check this programmatically? The concern is to find the maximum deviation and its location.

Howto be able to run the check on other types of objects as well: arc, polylines etc.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Program To Evenly Space Objects Across Given Distance

Dec 28, 2013

I would like to write some sort of AutoLISP program to evenly space objects across a given distance.  I have attached a .pdf file showing what exactly I mean.

I would like the program to enable me to either enter or measure (via the selection of two points) the "z" distance, to enter or measure the "y" distance, and to enter the number of objects, "n".  I would then like the program to evenly space "n" objects across the "z" distance.

A program like this is, I have to be honest and say, way beyond my current capabilities.

Perhaps some initial guidance to get me going? 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Program For Cross Section By Manual Input

Jun 26, 2013

Is it possible to write a program for cross section by manual input of data like below. Objective is to draw a cross section with grid lines and labels of section data and datum value.

Program will ask for :

Datum value ?
Grid line spacing ?

Datas are :

Section Left

Chainage  5     Section value : 12.5
                10                            13.5
                 20                            5
                 23.7                         3

                and so on.....

Section Right

Chainage  5     Section value : 8
                10                    13.5
                20.5                  15
                25                      3

                30                      14

               and so on.....

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Invalid Or Incomplete DXF Input - Drawing Discarded

Jan 4, 2013

While opening a dxf file, i find the message:

 Syntax error or premature end of file on line 943.Invalid or incomplete DXF input -- drawing discarded.

I have a approx. 10000 dxf files. Is it possible to know which files are invalid without opening them?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Locate WDP File With Minimal User Input

Sep 23, 2013

I am trying to locate a .wdp file with minimal user input.  this is what I have so far

;All file saved in this folder

(setq filedir "I://PROJECTS//")

;User will put the following in, but there might be a small description after 915-01.  That is why I have a wildcard

(setq filename (strcat "915-01*"))

; string together everything

(setq nextlevel (strcat filedir "JOB " filename "*" "//ACAD"))

;; the final path should look something like this:

I://Projects// JOB 915-01(something here... could be anything or nothing)//ACAD//915-01(something else could be here as well).wdp

;set file extension

(setq fileext ".wdp")

; search files

(setq wdp_file (vl-directory-files nextlevel (strcat filename "*" fileext)))

I am confused on where and when I can use wildcards for searching directories.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create New Double Line From Centerline According To Specific Distance

Jan 9, 2014

I have double line pipe drawings but i have to change distances between of this lines in entire drawing and i was thinking that maybe there is a lisp code which can create new double line according to my specify dimensions ...

example :

    Distance between lines : 100 mm

    ------------------------

    ------------------------

here is what i want to do :

1. select double line

2. specify new distance ( for example 200 mm)

3. lisp will create center line middle of the selected lines ( maybe it can ask me that this center line will be permanently or not )

4. lisp will create new double line from this centerline according to my specific distance

5. new double line layers will be the same with selected old double line

and this lisp has to work for double arc or quarter circles too.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Passing A List Of Points To Function Instead Of User Input

Sep 16, 2013

I have a list function that asks for the user to pick points when it is run. It looks something like this (foo arg1 arg2) When invoked it asks the user to pick points and press enter when done It.

Instead of getting the points from the user i want to pass it a list of pre-defined points. The code cannot be changed so I must use it as is.Is this possible, if so how can it be done?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: No Function Definition With Distance Function

Oct 25, 2013

This seems absolutly silly.

(setq p1 (getpoint))
(setq p2 (getpoint))

(setq Dist (distance p1 p2))

Why does this not work?

I'm trying to build a command to replace AutoCAD's "DI" command, to give distance and delta x, y, and z values in decimal and imperial, and keep the angles in XY plane and out of XY plane.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Continuous Dimension Lisp That Alternate Its Position

Jul 12, 2012

Is there a lisp that will allow me to do a continuous dimension, but will alternate the dimension position from low, high, low and high?  If there is no lisp already created, how to create one? 

See Continuous dimension attachment for example.

I work at a glass and glazing company and this is how we dimension mullion width and DLO. See typical window dimensioning attachment for window elevation with dimensions.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Add String To Each Item In List Using Lisp

Nov 14, 2013

I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg").  how would i go about doing that using LISP?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Opening Drawings With Default Visual Style Set To 2D Wireframe

Oct 7, 2013

Is there a way to programatically set a visual style before a drawing actually opens?

We have some huge models and people seem to forget to change their visual styles back to 2D wireframe before saving and exiting drawings.  Some models will crash on some workstations when trying to open in a rendered mode.

I found a lisp with a function that looked to set viewport visual styles.  But it does not seem to be supported anymore. --> (vla-put-VisualStyle vport 1)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Write A Lisp Routine That Invoke The Mleader Command

Oct 11, 2012

I'm trying to write a lisp routine that, when I invoke the mleader command, osmode is set to "nearest" & orthomode is set off. I then would like the original settings to be returned.

attached is what I have written so far:-

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Visual Effect Settings?

Jun 20, 2013

Lisp that switches back on Selection Preview i.e. thickens and highlights lines when you hover over them?I don't know why, but they are always unticking the boxes.

View 4 Replies View Related

AutoCAD 2013 :: Angle And Distance Input Methods

Nov 7, 2013

I was wondering if there is a way for me to setup Autocad so that instead of putting in S 88d20'12" W I could put in something like S88.20.12W so that I don't have to mess with apostrophes or "d." Also, can i do something similar with distance settings? Where instead of saying 5'-6 1/2" I can say 5.6.1/2. I know I could convert the measurements into decimals, but that would waste the time I would be saving with a faster input method.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Combinations In DCL?

Sep 7, 2012

Is it possible to execute a certain command based on multiple selections withinin a dcl?  for example:  two radio colums, one with selections A and B, and a second with selections 1 and 2.  is it possible to program commands based on user selections from each column?  ex: if A and 1- do a command.  A 2- do a different command, etc...

I tried :

 (action_tile "key1" "(setq A t")
 (action_tile "key2" "(setq B t")

 (action_tile "key3" "(setq 1 t)(done_dialog)")
 (action_tile "key4" "(setq 2 t)(done_dialog)")

(if
(and (a) (1)
)
(command ...

but was unsuccessful.  no matter which combination was selected, the command under all combinations would run.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Attribute Value

Jun 3, 2013

I am trying to find a lisp that would get an attribute value (tag name = NBR_5) . I'm trying to run a simple routine that would let the user place the value from the titleblock attribute as text on a drawing. I see a ton of articles regarding getting attributes but I am not well versed in programming.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Nil At The End Of Command

Jun 22, 2012

I have a routine that work fine, but I receive a nil at the end of command. How to fix that?

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 3D Point From X And Y?

Oct 9, 2013

I'm trying to find acceptable point values to feed to the vlax-3d-point function for a vla-addmtext function. With vanilla lisp I just provide the point as x y = "7/32" "2-3/8". So I assumed that I could drop a 0 in for the z like: (VLAX-3D-POINT "7/32" "2-3/8" 0).

Then I thought I was going to be tricksy and try (vlax-3D-point (getpoint)) believing that I could pick the point and get what I need to feed the function, but yet again, no deal. The command line gave me: 

node
of #<variant 8197 ...>

Nothing I can use in my code. So how do I find the point in a format that vlax-3d-point will like?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved