AutoCAD Visual LISP / AutoLISP :: Join Multiple Lines Together?
Aug 3, 2013I want to join multiple lines together like join command but with multi selection.
View 6 RepliesI want to join multiple lines together like join command but with multi selection.
View 6 RepliesProject involves repeatedly mirroring a line by selecting mutiple lines to do the mirroring. Probably sounds confusing.
The progress so far can be found here: [URL] ........
I need to divide thousands of lines into half, but AutoCAD divide command can only allow you to select one line at a time.Is there any way we can divide multiple lines at once.
View 9 Replies View RelatedI ment midpoint instead of center.Is it possible to select several different line entities and have them each rotated around its midpoint, or end point, so afterwards all have the same direction specified by a number or specified by direction of another entity?I wish command matchprop had that rotation option in its Settings.
View 9 Replies View RelatedHow to write an AUTOLisp program to label building dimensions. With Civil3d 2013 preventing me from labeling multiple lines at once, creating building labels to dimension complex building exteriors is much more complicated than it needs to be. Lisp Routine that Generates a MText or Dtext dimension centered on a line and offset to be clear of the line. the layer for this piece of text would always be "DIMS-BLDG" and the text style will always be "L50s."
the text doesn't have to be organized as it is in this example. the main focus is the layer being correct with the foot mark, precision set to xx.x and oriented to the line.
I am writing a program to grab a bunch of layers from a list, check a drawing to see if the layers are on the list, and if not save to an external file. I have the second part of the program done, but I can't get the first part to work.
I am trying to open a file read the contents and save it to a list.
Here is the code I have so far, but it doesn't even get into the foreach statement.
(setq layerslist (list '"0list" '"detaillist" '"clearancelist" '"clearanceelist" '"doorsdrawerslist" '"hiddenlist" '"hiddenelist" '"deletelist"))(setq count 0)(foreach thislayer layerslist (setq f (open (strcat "C:\filterlists\" thislayer ".txt") "r")) (while (/= (setq text (read-line f)) nil) (setq (read thislayer) (cond ( (= 0 count) (cons (cons 8 text) (read thislayer)))( (append (read thislayer) (list (cons 8 text))) ) );cond );setq (setq count (+ count 1)) );while (close f) );foreach
I've also attached one of the text files. Im doing something in the wrong order, or I have something inside the wrong set of parenthesis.
In continuation with thread All to Pline . I want to add one more function to this lisp i.e. Join all the objects selected.
Can this be done?
I tried this:
(command "_.pedit" "m" ename "" "j" ename "")or (command "_.pedit" "" "j" ename "" "")
But it gives me an error something like this:
Requires numeric distance, two points, or option keyword.
; error: Function cancelled
Enter fuzz distance or [Jointype] <0.000>: j
Enter join type [Extend/Add/Both] <Extend>: *Cancel*
or
Command: ch2pl
Select objects: Specify opposite corner: 5 found
Select objects:
*Invalid selection*
Expects a point or
Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon/Multiple]:
; error: Function cancelled
Select polyline or [Multiple]:
Enter an option [Close/Join/Width/Edit vertex/Fit/Spline/Decurve/Ltype
gen/Reverse/Undo]: *Cancel*
Command: Specify opposite corner:
Command: *Cancel*
I've been looking to download a lisp that can trim (TR) and the (PE, join) polylines. two at a time or multiple... I've tried writing the lisp routine but I cannot do it correctly.. Any good lisp routine? Also, if there's one to trim & fillet w/a radius.. Hopefully there's two different routines but if there's one then even better...
View 6 Replies View Related3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error. The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
I’m playing round with a loop but how to achieve my need..He had a 3rd party tool which didn't match our scaling needs the file is a fas so I have tried to reverse engineer the whole function using trial and error.
The following code works perfect except we need multiple (x amount) lines of text I have at current the M txt function which mimics and is effective for today however we need all lines to be individual.
;Starting lisp program...(defun C:REDtext ();Creating Layers (if non existant)...(command "layer" "m" "TEKST-1.5mm" "lt" "continuous" "" "c" "1" "" "");Memorising previous layer...(setq MYOLDLAYER (getvar "clayer"));Setting requierd layer...(COMMAND "LAYER" "SET" "TEKST-1.5mm" "");Setting variable "MYHEIGHT" to "DIMSCALE" x 2...(setq myheight (* 2 (getvar "DIMSCALE" )));Requesting and storing usser defind point...(setq MYPOINT (getpoint "Start punt :")); Requesting and storing user defind text...(setq MYTEXT (getstring T "Nieuw tekst :"));Placing text...(command "text" MYPOINT MYHEIGHT "0" MYTEXT); Restoring previous layer...(setvar "clayer" MYOLDLAYER);Closing lisp program...)
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?
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 RelatedI am trying to draw a line between two lines and I put together the following. It works great if the start/end points are perpendicular to each other. How do I solve if line one start point is in a positive direction and line two is in a negative direction?
(defun c:test ()
(setq L1 (car (entsel "
Select the first line: "))
L2 (car (entsel "
Select the second line: "))
)
[code]....
i know DIMANGULAR command will let me draw a dimension to display the angle between two lines, but is there a way for my commandbar to show me what the angle is rather than draw a dimension?
I often want to simply know the angle but not display it in the drawing, and it'd be good if there was a command/lisp which showed me in the command line area, or perhaps a pop up window, similar to what the TLEN lisp does here: URL....
I want to get the minimum and maximum x, y coordinate values of selected lines. In other words, i want to find the top, bottom, left and right edges of a set of lines.
Is it possible to achieve this with a lisp code?
Labeling lines with their lengths,
I got the attached lisp file from the web which automatically labels the lines with their length. Resulting the values of the length in the absolute values of the length instead of saying that the length is in inch. i.e, i need to remove the inch sign (") from the suffix of the length.
The PARTS LISTS on our old drawings are simply text entities and lines. Some are MTEXT. But our new drawing template has us creating our parts list using the actual AutoCAD TABLES entity.
I'm looking for the best method to go from lines and text in AutoCAD, to an AutoCAD table. As of now, I have to retype everything since I can't select a column/row or group of text entities, copy/paste into a table.
Any LISP function that will allow me to go from TEXT and LINES to a TABLE? I've tried B2E (lisp name) but it's not working - found that on a lisp site somewhere.
I need lisp that do a line between 4 lines.
View 7 Replies View Relatedhow 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 RelatedI am testing 2010 lisp routines in 2013. One thing I noticed is princ lines are not showing up on the command line until after the lisp routine has finished. Is there a setvar that controls this behaviour?
View 7 Replies View RelatedLisp code here for draw for example triple parallel line ? each line will be own layer and color..
View 8 Replies View RelatedLISP routine for rotating lines so that text in linetypes always reads from left to right?
I use the QUERY command to create basemaps and often the lines that are imported read upside down or backwards or however you prefer to look at it. Most often, if I look at the XY coords of these backwards lines, the End X coordinate is of a higher value than the Start X coordinate.
Looking for something that would compare the two X coordinates of a line, do some sort of an IF Start X > End X, and if its true, store the XYZ coords of the Start and End in some variable, and swap them.
I have about 30 profiles with water pipe lines that I need to measure all their vertical angles. since the vetical scale is exaggerated so I can't use the acad angular icon tool bar. Only thing I cant think of is to block each run then import them back in at 1/10 in y direction. How to get this done faster or more direct by any other methods.
View 6 Replies View RelatedI need a lisp code to convert all Lines, Polylines, Arcs and Splines to Polylines with 0.4 width.
I prepare this:
(defun c:CH2pl ( / SS);changes all lines, plines, arcs and splines to POLYLINE with 0.4 width(if (setq SS (ssget "_X" '((0 . "LINE"))))(command "_.pedit" "m" SS "" "Y" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "*POLYLINE"))))(command "_.pedit" "m" SS "" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "ARC"))))(command "_.pedit" "m" SS "" "Y" "w" 0.4 ""))(if (setq SS (ssget "_X" '((0 . "SPLINE"))))(command "_.pedit" "m" SS "" "Y" 10 "w" 0.4 "")))
But I want pure lisp code in a professional way!
I want to make many object cooper lines in autocad and each line has some data about its length, size, type etc. that can then extract to excel as a Bill of materials.
View 1 Replies View RelatedI need lisp that draws rectangle between two lines by window selection. As attached.
View 3 Replies View RelatedI want to draw a line which shows a particular color scheme, I at current do this by drawing a solid line of one color and then use a dashed line of another color top go over it.
The obvious problem is that these lines are being double drawn. Is there a way using lisp that I can draw both lines at once?
I am working on a script. I need to select all lines and polylines and set there linetype scale to 1.
I'd take a simple lisp routine if that would be easier.
There are two lines in attached drawing. It seems FLATTEN doesn't work on them. How can I flatten them with lisp code?
View 9 Replies View RelatedI 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.
I need a easy way to create a lot of small regions, or divide a big region in lines intersections, or a fast way to pick points inside objects.
Its like that:
imagine that you do 100 horizontal lines and then 100 vertical lines. Now you have 10.000 squares. i need a fast way to make a region in each one of then.
So its too much trouble to pick points inside each one of then. i need to divide a big region or a fast way to create Plines or objects with the little squares. And i cant use array because they aren t regular squares.
Its something that i do often, its not a one time thing. This is necessary in structure analysis modeling, i export this dwg to a dxf file, that i use on a finite element program.
i never did a lisp before.
Is there any utilities that can select the entire drawing with the 2d polyline and erase all the polyline less than specify length (eg:10m,20m etc) ?
View 4 Replies View Related