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
ADVERTISEMENT
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
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
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
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
Jul 18, 2013
I have subroutine that retrieves a list of detail numbers in a drawing. Sometimes there are missing numbers. I am looking to find a list of any missing numbers.
Example -
(setq List_DN (list 1 2 3 5 6 7 10 11 12 17))
Missing numbers are - 4,8,9,13,14,15,16
I would like a subroutine to take the List_DN are return the following missing numbers as text
(Get_Missing List_DN)
return
4,8-9,13-16
View 9 Replies
View Related
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
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
Feb 22, 2013
I have multiple floor plans in a drawing one of which I need to explode 3-4 times to change the lineweight to 9mm. I have tried to put something that will repeat explode but I am having problems with plines within the blocks not exploding.
(defun c:tmp (ss)
(setq ss (ssget))
(setvar 'qaflags 1)
(repeat 3 (vl-cmdf "._explode" ss ""))
(setvar 'qaflags 0)
(vl-cmdf "chprop" ss "" "lw" "0.09" "")
)
View 9 Replies
View Related
Aug 31, 2012
acad_strlsort will sorts strings, but what if my list looks like
("1" "2" "3" "10" "11" "12" "20")
i am sure i have seen it done ina simple way using vl-sort or vl-sort-i
but am not able to find...
View 5 Replies
View Related
Mar 2, 2013
Lisp file to get serial letters and numbers from existing ones,
I got a lisp file (attached) from experts in the form which does generate serial letters and numbers from existing ones.
The issue with this lisp file is that it doesn’t give the opportunity to choose the direction of numbering (top to bottom/bottom to top/left to right/right to left) as shown in the screenshot below
How this lisp can be developed to give the user the chance to choose the direction of numbering?
View 9 Replies
View Related
Apr 5, 2012
I have draws with a a lot of layouts.In each layout, there is a block (CARTOUCHE) with a an attribute (PAGENUMBER)
I am looking for a way to select the block in my first layout, indicates a number for my attribute (PAGENUMBER). The lisp will automatically increase the attributes of the next others layout. How can I start this lisp.
View 9 Replies
View Related
Apr 16, 2012
I have an opportunity to make a good impression at a new job, but ive never had the initiative to learn how to write a lisp routine. at my work we make walk-in coolers and freezers. these coolers are modular with a standard wall piece measuring a certain length. these wall sections have to be numbered sequentially. is there any way to automate this? sometimes we get change order from the client and it means going back and manually changing multiple texts (sometimes in the hundreds), but i thought if there was a way these wall sections could be scheduled somehow that when a new wall panel is inserted in the beginning of the sequence it would update everything after it automatically.
View 9 Replies
View Related
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
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
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
May 8, 2013
Lisp code here for draw for example triple parallel line ? each line will be own layer and color..
View 8 Replies
View Related
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
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
Nov 13, 2013
i need a vlisp program to draw polyline between two blocks.
View 3 Replies
View Related
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
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
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
Jul 23, 2004
Routine that will draw a insulation hatch around a circle?
View 9 Replies
View Related
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
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
Jul 21, 2003
Is there a lisp routine to draw 3D object by the LOFT way ? .
View 4 Replies
View Related
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
Sep 15, 2000
how to draw a geodesic dome shape? some sort of lisp routine perhaps...
View 7 Replies
View Related
Jul 18, 2012
I'm trying to write a lisp routine to create a two line MLEADER but i can only get one line of text. Creating the MLEADER manually from the command line i just have to hit enter after the first line of text to add a second line. How would i do this in a lisp routine?
View 2 Replies
View Related
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