AutoCAD Visual LISP / AutoLISP :: How To Make Different Start Points For Different Commands

Jun 29, 2013

My first lisp, so bring it hard on me I want to be an expert in autolisp .

My lisp is meant to do the following:

draw a rectangle with ”0” fillet. It can be done either via rectangle command, or pline command. The attached lisp has the variant with the pline-case.

The, I need to draw inside a smaller rectangle, with a fillet value, that is promoted and indicated by the user. The smaller rectangle must be centered inside the bigger one. I thought it was a good idea, to take one insertion-point for the bigger rectangle.

and to calculate a 2-nd insertion-point for the smaller rectangle, via "polar" function.

What I get:

the 2-nd insertion point is put the same as the 1-st one.

I wish to draw the bigger rectangle with one layer "example: Layer 1", and the smaller rectangle with another layer "example: Layer 2".

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Can't Pickfirst For Some Commands

Nov 7, 2012

I've been testing out a few lisps just now, trying to get to the one I want.Somewhere along the line something has changed a setting in the program and I don't know what or how to get it back.

Similar to the PICKFIRST sysvar, but not that.  (PICKFIRST is set to 1).

When I select objects and issue a command like move or copy, all is fine.

When I select objects and hit Ctrl+C, the selection set is ignored and I am prompted to select objects.

When I double click on text to edit, the ddedit or mtedit command is issued at commandline, and I am prompted to select an object.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Override Existing Commands

Mar 19, 2012

Any way to override existing AutoCAD commands.

Lets try this.  When a user types "line" at the command prompt, or hits the "line" button on the toolbar, or chooses "line" from the draw pulldown menu, is there any way I can re-write what line means and draw a circle?  (Extreme example)

There are just some commands that I'd like to have a variable set in the background, depending on what the command is.  So I'm thinking if I could re-write the "line" command, instead of trying to convince everyone to use and remember a custom command, it would be much more efficient.  There are lisp files already loaded in their start-up suite.  Not sure if that works.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Autosave After 20 Commands Except Zoom

Dec 18, 2012

I just started learning LISP yesterday, as our office needs an autosave LISP. People have requested it and I have to do it...

How I wanted to do it:

The LISP will be loaded on every PC of every person with AutoCAD.

On startup "command_count" will be on 0

When using a command like plinie this happens: (+ 1 command_count)

Commands like zoom, undo etc will be ignored

When command_count reaches 20 it executes the qsave command

If using the qsave command it resets the command_count to 0

Thats my not working LISP atm:

(defun c:losave ()(setq command_count 0)(+ 1 command_count)(if command_count 10 "_qsave"));(if command "_qsave" setq 0);(if command "_zoom" (- 2 command_count));(if command "_undo" (- 2 command_count));(if command "_qsave" (* 0 command_count));(setq command_count (+ 1 command_count))

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Combined Commands In One Macro Button?

Jun 28, 2012

I am trying to create a short cut button with a macor code.

I want it to set up a new orgin and set a base point in xrefs i am creating

The commands i want to combined are the follwoing

UCS enter
3P enter
BASE enter

The macro i am using is the following

^c^c_ucs 3p \_base

but it wont run the base command after it finishes the 3P command

This is whats show up in my commands bar

Command: _ucs
Current ucs name:  *WORLD*
Specify origin of UCS or [Face/NAmed/OBject/Previous/View/World/X/Y/Z/ZAxis]
<World>: 3p

[Code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Customise Snap Commands To F Keys

Feb 10, 2009

Im using AutoCAD 09 for the first time and need to find out how to customise my snap commands to F keys. I've been using 2004 and it was really easy. 09 seems to not allow it?

for example i set F4 to end point and F5 to intersection point etc. it saves using O snap or a tab. just L, F4 and its done (for example)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Use Ordinary Commands In Blocks Without Block Edits

Sep 12, 2013

i like to work with block system in my project , but i dont like to use block editor or refedit for every action inside my block  ...i found some lisps for  add or remove objects from blocks but not enough for dont use to block editors ,  i need to lisp for use ordinary command for blocks without get them inside if ther is possibility ...

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Commands Not Finishing After Calling Script Within Function

Nov 15, 2013

I have a simple lisp function to add a scale axis to a drawing by calling a script, renamed the drawing by appending "withScale" to the file name, and then closing the file. I placed a call to the function in the acad.lsp file in the startup suite. The idea was to batch process all files by simply opening them. Upon open the startup acad.lsp file runs, which calls my lisp function, which in turn calls the scale script. It should then execute the renaming, saving, and closing commands. The problem is that it is calling the script fine and renaming the file, but it does not save the changes before closing. Here is the lisp function
 
(defun saveScale(); (command "-purge" "all" "" "n")(if (findfile "C:/Users/Russell/Desktop/TreeFiles/Automation/Scale&Key.scr")(command "_script" "C:/Users/Russell/Desktop/TreeFiles/Automation/Scale&Key.scr")); end if (command "_.zoom" "e") (command "_saveas" "2013" (strcat (getvar "dwgprefix") (vl-filename-base (getvar "dwgname")) "withScale.dwg")) (command "close") ) (saveScale)
 
Apparently you cannont run any lisp commands after calling a script, however the renaming still follows through.

I've attached the script file as well. (I couldn't attach .scr format so you may need to rename it).

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: End Of One Line Is Start Of Another

Apr 24, 2013

I am having a problem with starts and ends of lines. I have draw two lines, end of first is start of second. The problem is because, (cdr (assoc 11 (entget line1))) and (cdr (assoc 10 (entget line2))), somehow, are not the same,

(= (cdr (assoc 11 (entget line1))) (cdr (assoc 10 (entget line2)))) 

is returning nil, what is so confusing to me is that:

(=(nth 0(cdr (assoc 11 (entget line1)))) (nth 0(cdr (assoc 10 (entget line2)))))

is returning true, the same is for y and z coordinates.

I need to check x y and z coordinates, for this type of problem...

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Multiple DWG Files With Basic Set Of Commands In Script File

Jul 19, 2013

I can run the ACC fine on multiple DWG files with a basic set of commands in the script file.  But, when I try to load an AutoLISP/Visual LISP file and run it from inside the script file, it doesn't work. How to run a LISP file using the ACC?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Partial Cuix - Adding Commands To Shortcut Menus

Oct 17, 2013

I'm able to add custom panels/buttons into the Ribbons, by cloning the existing ribbon (from acade.cuix) into my partial cuix. However.. I'm not able to add more commands to the shortcut menus, using the same technique.

Is it possible to add custom commands to existing shortcut menus using a partial cuix?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Pline Start And End Angles

Dec 3, 2012

Is there a function to obtain the start angle and end angle of a pline, i know arcs do.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Start Profile Over From Scratch

Jan 17, 2013

ACAD 2009 on XP

Third party software installed which now causes AutoCAD 2009 to crash when a single key is pressed. We have uninstalled the software, however the editor is still looking for the

Non-existent ARX. This is the problem. What file or registry key declares the list as shown in APPLOAD? I have verified 2009 works in the administrator profile.

We also did a repair and then a reinstall of 2009 to no avail. What steps are needed for AutoCAD to build a profile when a previous profile existed?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Start It With No Drawing Open?

Nov 13, 2001

can you start autocad with no drawing open ?

i would think that some type of script would work or could you change your target on a shortcut?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Z Value For Points?

Jan 5, 2012

I have a drawing that has 2D pipeline (only x and y, z value =0) and 3 topo contour lines ( with x, y and z vaules). I need to divide the the 2D pipeline into say 2000 points and then get the corresponding z values from the topo contour lines. I think it can be done by interpolating between the z values for the two apparent intersection points of the 2D line and the contour lines, the x and y values will be the same for the points that falls between these two aparent intersections. Is there any lisp out there that can do that.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Find Start And End Point Of AEC WALL

Jan 29, 2003

Using Lisp or VLisp, how can I find the Start & End Point of an AEC_WALL ent. ?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Start MS Access 2010 In Runtime

Oct 13, 2013

I try to start msaccess in runtime mode, but an .accdr will not start.this is the code try to use, without /runtime in the code the .mdb and .accdb works great

(startapp "C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" /runtime path)

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Start Command On Existing Selection Set?

Jan 29, 2012

I'd like to pass and existing set of selection to a command like laylck, which asks for selections after beginning the command. 

It must be possible to do this. Some CUI setup, lisp routine?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: True Coordinates Start And End Of Layout Page

Mar 28, 2012

I’m trying to create a view port, which covers my entire layout (white/ page area) using the following command
 
(command “mview” ‘(0 0 0) ‘(297.5 210 0))

However as you will note 0,0,0 is not the very edge corner of my layout (white area) and my white area is smaller then 297.5x 210mm (standard A4 landscape size)

How to obtain the exact measurements and starting coordinates to fully fill my entire layout page (white area)?

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Circles At Line End Points?

Feb 2, 2012

I need to place a circle, of a user-defined radius, as a marker at the endpoints of all lines in a drawing.  how to accomplish this using lisp?  It doesn't matter if they overlap; I can use OVERKILL to delete those objects.

I started the code with:

(defun c:cmark ()
(setq crad (getdist "
Specify radius: "))
)

But don't know how to cycle through the objects, determine the end points of lines only.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Corresponding Z Value For Say About 2000 Points On Pipeline

Dec 19, 2011

What I have is a topo plan in 3D (All contour lines have x, y and z values). My pipeline is on x and y coordinate only. I need to get the corresponding z value for say about 2000 points on the pipeline.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Surface Angle With 4 Points

Nov 6, 2013

I need very very often to know the angle between two surfaces to write cnc programms...At the moment i draw allways two lines normal to the line between the two surfaces an use then the angle measuring tool.Works good, faster then bks and dimensioning, but need also time and always need to delete the lines after...

Is it possible to get a lisp which ask für 1 point on the first surface, 1 point on the other surface and two points on the line between the 2 surfaces? So the lisp know 3 points of each surface and can give out the angle between... Should be allways between 0-180°

So it needs only 4 klicks to get a angle! That would be so great! Is there a lisp programmer who can make this possible?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Use It For Drawing Lines Between Two Points

Aug 19, 2013

how to use AutoLISP to draw lines between two points. I have x,y,z coordinates for the end points in an excel sheet which I can save as a text file. I need to pull the coordinates from the file and use them to draw the lines. There are 2000+ lines so it is not feasible to draw them manually.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Dimension Between Two Points In A Selection Set

Nov 1, 2011

Looking to make a selection set of points that are on a specific layer, and then create a dimension between, in this case, two points. I feel like it should be very simple, but I can't get it to work for the life of me. Here is the test code I've been playing around with:

(defun c:test (/ sel1 TC)
(setq sel1 (ssget "X" '((8 . "VPOINTS"))))
(setq TC (polar (entget (assoc 10 (ssname sel1 0))) (dtr 180.0) 9))
(command "DIMLINEAR" (entget (assoc 10 (ssname sel1 0))) (entget (assoc 10 (ssname sel1 1))) "V" (polar TC (dtr 180.0) 9) "")
[code].......

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Finding 2 Points Along A Pline

Jul 7, 2013

I have plines of circuits that sometimes have T's (line goes along, then T's out then back to T point and then continues).

Here is example line -

(setq List_Pline (list (list 0 0) (list 1 1) (list 0.5 1.5) (list 1 1) (list 2 2) (list 3 3) (list 3.5 2.5) (list 3 3) (list 4 4)))

nth 0 = (0 0)
nth 1 = (1 1)     - T point
nth 2 = (0.5 1.5)
nth 3 = (1 1)     - T return point
nth 4 = (2 2)
nth 5 = (3 3)     - T point
nth 6 = (3.5 2.5)
nth 7 = (3 3)     - T return point
nth 8 = (4 4)

I need to be able to pick 2 points along the line and find the shortest route.

Examples - 

1st point at 1,1 and 2nd point at 3,3 - new line is nth's 3,4,5

1st point at 0,0 and 2nd point at 1,1 - new line is nth's 0,1

1st point at 2,2 and 2nd point at 3,3 - new line is nth's 4,5

1st point at 3,3 and 2nd point at 4,4 - new line is nth's 7,8

1st point at 0,0 and 2nd point at 3,3 - new line is nth's 0,1,2,3,4,5

1st point is 1,1 and 2nd point is 1,1 - new line is nth's 1,2,3

I've tried using vlax-curve-getParamAtPoint, but it returns 1st T point.

Synopsis of program -

Select Pline

Pick 1st point

check if on line

Pick 2nd point

check if on line

check if 2nd point is before 1st point, if so swap locations

find last nth of 1st point

find 1st nth of 2nd point

return list

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get End Points Of Invisible Line?

Aug 23, 2013

I am trying to get the end points of an invisible line it would be the line that you offset I know all about polar I just don't know which angle to add or subtract and I will pick the point on the side I want it to be on I am going to pick 2 lines and I want them to offset invisible lines in the middle the lines are not parallel.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Entmake Mtext Start And Stop Underline And Styles

Jun 4, 2013

I am trying to create an mtext entity using entmake with different text height, text style and underlining. I have a subroutine that works fine. However - I would like to use different text height, text style and underline for the Title Text vs the following lines.

Here is the subroutine I already have -

(defun Create_MText (MT_PMS MT_Layout MT_Layer MT_Style MT_Justify MT_Point MT_Rotate MT_Size MT_Width MT_Title MT_Body / )
(setq FSC_MText
(list
(cons 0 "MTEXT")

[Code] .......

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Tangent Line And Pass Through Two Points

Aug 20, 2012

We have a need to select a tangent line/polyline etc and then select two other points we would then like to have the program draw an arc through the two points and yet still be tangent to the initial line/polyline that we picked.  We don't care what the radius is as we believe there is only one solution anyway.  It would be wonderful if we could just use the Arc command and select start>Second Point> then just use the Tangent Osnap but I guess that is out of the question :-)

The only code that I have come across that even resembles this only allows for one point not two (STILL VERY HANDY AND VERY SLICK)

(vl-load-com)
(defun near_vertex_arr (obj / dxf_obj e_next obj_vlax pt_sel par pt_first pt_snd i bulge)
;bruno.valsecchi

[Code]....

How does everyone else hande this?  By they way... I dont care what language it is written in :-)

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Incrementing Pick Points Alphabetically

Aug 8, 2013

I know how to increment pick points numerically (see below). How is it done alphabetically?
 
(defun C:test (/ pt# pt) (setq pt# (getint "
Enter number: ")) (while (setq pt (getpoint "
Specify point: " ))(if (/= pt nil) (progn (command "TEXT" "M" pt "" "" pt#) (setq pt# (1+ pt#)) ) ) ) (princ))

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Missing OSnap Points With PDF Files

Mar 12, 2013

I am using autocad 2013 and importing PDFs into the drawing and recently the OSnap points within the pdf are missing. The PDFs are of floorplans and I was able to measure from wall to wall using endpoints and midpoints. Now I am only able to select the endpoints on the frame of the pdf.

Is there a switch that might have been turned off?

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove Duplicate Points From A List?

Aug 5, 2013

I am looking for code to remove duplicate points (xy coords) from a list with a fuzz factor parameter.

View 1 Replies View Related







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