AutoCAD Visual LISP / AutoLISP :: How To Draw Triple Or More Lines

May 8, 2013

Lisp code here for draw for example triple parallel line ? each line will be own layer and color..

View 8 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Code To Draw Grid Lines

Jan 1, 2014

I have this code to draw grid lines within a rectangle:
 
;Variable settings(defun var_set () (setq *var_lst* '("cmdecho" "osmode" "expert" "plinewid" "dynmode") *var_usr* (mapcar 'getvar *var_lst*)) (mapcar 'setvar *var_lst* '(0 0 2 0 0)) (vl-load-com))(defun var_reset ()(mapcar 'setvar *var_lst* *var_usr*)) (defun *error* (msg) (if (not (member msg '("console break" "Function cancelled" "quit / exit abort" "" nil)) ) (princ (strcat "
Error: " msg)) ) (and ;(vl-bt) (var_reset) ) (princ) ) (defun string-list (data) ;by lee-mac @theswamp (if (vl-string-search "@" [code].........

The above gets me the grid lines; but I have a block inserted at both ends of the grid line; how do I get the selection of those entities (selection set "frame") after each array?

or I would need to map a point list and draw each grid individually how do I go about that?

Attached is the sample of the output I'd like to achieve using LISP.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Divide Spaces With Max Gap - Draw Lines Between 2 Points

Feb 6, 2012

I have to put some trusts between two beam. It sounds easy but i'm unable to handle the divide and round off commands in the lisp. See attachement also.

To draw my trust between the 2 beams, what I normally do, is that I manually take the distance between the two points say it's 10 000 and wrote it down. Then I divide it by my max gap, say 1200, it is the max space between trust.

10 000/1200 = 8.333333 that's the result of how much trust and space between them that i'll need, 8 trusts, 9 spaces between the 2 beams. (That is what I'm unable to do in the lisp, tell it to round off 8.333 to 9 and use 9 for divide command)

What I manually do at this point to draw these trust is that I must create a temporarly line between the 2 beams, perpendicularly to these and divide it by 9.

It gives me 8 cross (or point) to draw my trusts. All this is long to do manually because I have many bay in building and I have to redo this operation for every the bay.

So, what I would like the lisp to ask is:

Specify distance between two beams (Between where and where) :

Specify the lenght of the trust :

Specify max gap: I would like to answer a number here, say like 1200 max

(The lisp should draw the lines on the current layer, color and linetype of the current layer and not draw a line at the beginning and at the end because that's where my Beams are. I hoped you understand, see attachement.

Should also have something that handle a ESCAPE hit or cancel, something like this:
 
(defun trap1 (errmsg) (command "_.undo" "_end") ; undo end (setvar "osmode" oldsnap) ; restore variables (setvar "cmdecho" 1) ; enable cmdecho (setq *error* temperr) ; restore old error handler (prompt "

[Code] ....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Program Loop To Draw Lines With Rubberband

Oct 4, 2012

i am writing something that will draw consecutive lines with a rubberband to be used as a leader from a block's insertion point.  this:

(WHILE
 (SETQ LN (GETPOINT "
Select Next Point (ENTER to Finish) : "))
 (COMMAND "LINE" (GETVAR "LASTPOINT") LN "")
)   

works, but does not include the rubber band.  i tried:

(WHILE
 (SETQ LP (GETVAR "LASTPOINT"))
 (SETQ LN (GETPOINT LP "
Select Next Point (ENTER to Finish) : "))
 (COMMAND "LINE" LP LN "")
)   

which includes the rubberband, but will not exit the loop. The last break source in VLIDE shows that  

(GETPOINT LP "
Select Next Point (ENTER to Finish) : ") is casuing an error.  Placing
 (SETQ LP (GETVAR "LASTPOINT"))

 outside the loop causes all lines to be drawn from the same point rather than the endpoint of the previous line. 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Intersect Between Two Lines Using Start And End Values Of Two Lines

Oct 11, 2013

With all of you fine teachers, I have the know-how to get the start and end values of a line.

Do you think there is a way to get a point returned that represents the true intersection of the two lines, without having to involke a user defined "getpoint" function using "intersect" osnap?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Construct Lines Between Lines Ending Points Multi Selection?

Aug 3, 2013

I want to construct lines between every two line ending point by multi selectio window instead of drawing it manually between lines ending point ?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Line In A Layer

Jun 5, 2013

How do I select the layer in which I want to draw?

for example i draw two line and Each of them has to be in different layer.

How do I select the layer  which I want to draw?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Polyline With Clipping Outside

Mar 7, 2012

is there a way to draw a polyline and have autocad clip everything outside of that polyline and discard it so that i end up with a smaller drawing.  only the information in that polyline, nothing outside of the polyline

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Text Entity In 3D

Apr 29, 2012

how to draw a text entity in 3d, where I know the 3d ins point, and the plane it should be flat to.

I have not drawn text or inserted blocks programatically before where the plane they lie on is not flat.

I have done it before by setting a ucs and drawing stuff, but now I want no switches of UCS involved.

[URL]

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Rectangle Dimension?

Apr 17, 2013

how I would go about writing a function that would calculate the length of a diagonal of a rectangle using SQRT function? I've been trying but so far nothing!

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw All Objects At Same Time?

Sep 24, 2012

I have made a lisp routine to draw lines on polyline. And here are a lot of lines on it. So using comand

"(command "line" pt1 pt2 " ")"

takes a lot of time. Is here a way to creat lines in memory or similar and only then draw them all on screen?

I have search but coudin't find any info. I do not know how to formulate a query.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Unable To Draw A Line

Sep 18, 2013

I've written my first little Lisp function.What it's for is drawing a simple borehole profile that can then be used to draw stylized cross sections on top of it.

Upon start the lisp, pick a point on screen (to get the X coordinate [x1 below]), then enter ground level at the command line [g1 below], then enter as many thicknesses as are present in the borehole log (will vary, but typically between 3-12). These I added to a list, because that seemed to make sense when I did it.

What I want it to do then is draw a pline from x1, g1 down to the next point (x1,g1 minus the 1st thickness), then the next (x1,g1 minus the 2nd thickness) etc., to the bottom of the borehole.

Then my CAD guys can sit there, and using the borehole logs, enter the values of the boreholes and it draws them on the screen, making it easy to join th dots.

It might be good if it placed a Acad point at each point as well, but I'm not overly bothered about that at the minute.

Here's my attempt so far.

(prompt "Type 'e1' to run...")
(defun c:e1 ( / )
(command "graphscr") (setq x1 (getpoint "
Pick insertion point:")) (setq x1a (car x1))
(initget (+ 1 2 4))   (setq g1 (getreal "
Enter ground elevation: "))
(initget (+ 1 2 2)) (setq lvllist nil )   (while   (setq lvl (getreal "
Enter layer thickness <Exit>: "))   (setq lvlList (append lvllist (list lvl))) )
(princ) )

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Square By Area

Nov 27, 2013

I would like to be able to draw squares by the area they should have. So that if I need a square of 50m2 autocad automatically draws a square of sqrt(50) x sqrt(50)

Because right now I have to draw 200 squares with 100 different areas and I have to calculate and manually draw each one of them.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Draw Polyline Between Two Blocks Of Same Name

Nov 13, 2013

i need a vlisp program to draw polyline between two blocks.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Bounding Box At Current UCS

Oct 16, 2013

The first rectangle is drawn from 0,0 at the World Coordinate System. There is never any trouble with the code below when the objects are drawn at the WCS. The problem is when I try to draw a bounding box around an object while in another UCS. It seems that it always draws the bounding box at the WCS instead of my UCS. I have used (trans <pointlist> 0 1) on all combinations it seems and I still cannot get it to draw the bounding box at the current UCS. 

(defun c:GetFromBoundingBox (
/
*ACAD_DOCUMENT*
mspace 
pSelectedObject
lwLeft
upLeft
lwRight
upRight
[code]...

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Extract Attribute Tag Value And Draw Polyline

Apr 25, 2012

I have a inserted block with 4 tags for Length, Thickness, Elevation and Width.How can extract attributes tag values and draw a closed polyline + 2 internal lines, parallel to the block?

Block Name: ID_DATA
Tags: LEN, THI, ELE and WID.

Each internal line placed in a third width.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Insulation Hatch Around A Circle

Jul 23, 2004

Routine that will draw a insulation hatch around a circle?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Polyline Which Point From Sub-entities Possible?

Jun 28, 2013

I continue learning....

(setq ins (vlax-ename->vla-object ( ssname sele cod)) nombre (vla-get-name ins) ) (setq bloque1 (vla-item (vla-get-Blocks (vla-get-Document ins) ) nombre ) ) (setq s_ent1 (vla-item bloque1 1)) (setq pt1 (vla-get-startpoint s_ent1 ))(setq pt2 (vla-get-endpoint s_ent11 ))(setq s_ent2 (vla-item bloque1 2)) (setq pt3 (vla-get-startpoint s_ent2 ))(setq pt4 (vla-get-endpoint s_ent2 ))(command "_pline" pt1 pt2 pt3 pt4 "c")

Why dont draw de _pline?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Doors And Windows In 3D From Block In 2D

Jul 4, 2013

i make  a lips that  draw doors and window in 3d from block in 2d......the problem..It does not work in all autcad¡¡ the same version but different  pc.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Draw 3D LOFT Object?

Jul 21, 2003

Is there a lisp routine to draw 3D object by the LOFT way ? .

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Line On List Of Points

Jul 7, 2012

I have a list with many points is it possible that i can draw a line or polyline on those points using MapCar function.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Polyline Objects - Draw MLINE

Sep 2, 2013

I have drawings with a lot of polyline objects. I need a routine which will draw multilines by coordinates of vertexes of this polylines. For example, if there is a pline with coordinates 10,10 - 20,20 i want to draw in other layer MLINE with the same coordinates. I know it's should be simple but can not gues how to do it. I've never used LISP before.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Geodesic Dome Shape?

Sep 15, 2000

how to draw a geodesic dome shape? some sort of lisp routine perhaps...

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Read Attribute (diameter) To Draw Circle?

Oct 21, 2013

Can a AutoLISP command be written to read an attribute in a block and draw a circle with the attribute as the diameter using variables? The appilcation is taking the diameter of a tree trunk (the attribute), multipling by 12, and drawing the canopy circle on hundreds of those blocks. So the circles drawn will vary in size.

Not sure how this could be set up, i'm not familiar with LISP writing at all.

1) Read block, single, mulitple or definition?

2) Read Attribute

3) Varaible of attribute, (attribute is an inch measurement...it needs to be multipled by 12 to get feet for final use as circle diameter drawn)

4) Draw circle, variable, with diameter coming from attribute variable (attribute in inches that is multipled by 12)

5) Center point or circle to be block's base point

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Line With Previous Middle Point

Jun 5, 2013

why do not draw the line between ptm1 and pt3?

(defun c:PUNTOM (/ pt1 pt2 pt3) (setq pt1 (getpoint "
Initial point : ")) (setq pt2 (getpoint "
Final point : ")) (setq pt3 (getpoint "
Offset : "))(setq ptm1 (mid (pt1 pt2))) (command "_line" pt1 pt2 "")(command "_line" ptm1 pt3) (princ));;;;;;;(defun mid (p1 p2) (list (/ (+ (car p1) (car p2)) 2.0) (/ (+ (cadr p1) (cadr p2)) 2.0) ));;;;;;;;

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw An Ellipse At A Specific Point On A Drawing

Mar 18, 2008

I need to draw an ellipse at a specific point on a drawing.

i can calc the major and minor and i have a polar point of where it should be drawn.

i just need the code to draw the ellipse.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Draw Walkway Path For A Roof

Jan 3, 2014

I do a lot of repetitive tasks in my daily drawings and I’d like to make life easier!  I was researching how I could write a lisp to draw a walkway path for a roof.  I came across a couple of interesting posts but couldn’t follow the code because of my lack of understanding the language. 

So what I do is draw a 30” x 30” square (using the rectangle command).  Then copy it so there is a 2” gap between them.  Then I go back and hatch them with a dot hatch scaled to 96.  What I’d like to do is type a command and it would draw the walkways for me and hatch them if possible.  The problem is the last one is a custom cut size depending on the length of the walkway run?

Now I know I can draw a line, draw the square, hatch the square, array it on the path with set distance between items, then fix the last one so it looks the way I want it to, and then delete the line.  But why do all that when I have a program that allows me to customize it to be done for me? 

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Line Trim - Draw Lots Of Plumbing Plans

Jan 9, 2013

This is to trim a line that crosses another.  I draw lots of plumbing plans.  It draws a circle based on 'dimscale', trims a line to that circle, then erases the circle.  The problem is if you miss the trim point (PT2) it does not erase the circle and you lose your object snaps.

;Pipeline Break
(Defun C:bb (/ s1 ds1 r1 PT1 PT2 AX)
  (setq s1 (getvar "osmode"))
  (setq ds1 (getvar "dimscale"))
  (setvar "osmode" 63)
  (setq r1 (* ds1 0.03125))
  (setq PT1 (getpoint "
[code]....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Line / Pline To Match TEXT Rotation?

Oct 7, 2011

There are a ton of lisp to match text rotation to a selected line, but not vice versa.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Draw Line Between All Matching numbers That Are Repeated 3 Times

May 22, 2013

I'm looking for a lisp routine that will draw a line between all matching numbers that are repeated 3 times or more in a selection.I'm using AutoCad 2012.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Set Z Axis Orientation To Two User Points To Draw And Extrude Circle

Feb 10, 2012

I'm trying to change a routine i just wrote that draws 3d pipes. I wanted to make it so that when a user selects the beginning point and ending point of the pipe, the LISP changes the ucs to that vector, draws the circle at the beginning point and extrudes it to the second point.

It actually works great except when the ucs changes, so do my user points because of teh origin change. Is there a better way I might get this to do what I wnat it to?
 
(setq ip (getpoint "
Pick First Point:"))(setq ep (getpoint "
Pick Second Point:"))(command ".ucs" "za" ip ep)(setvar "osmode" 0)(command ".circle" ip "d" od)(command ".extrude" (entlast) "" (distance ip ep))(command ".ucs" "w")(setvar "osmode" oldsnap))

View 2 Replies View Related







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