Search the Community
Showing results for tags 'line'.
-
autolisp writes the intersecting line layer name to the center of the block
bery35 posted a topic in AutoLISP, Visual LISP & DCL
Hi, I tried to write an autolisp code and I got to a certain point, but it is not working as I wanted. I would like your suggestions and your support in revising the code. What I want to do is select a block. To find out which character (n) from the right is the "-" sign in the layer name of the line touching the block I selected. Then subtract 1 from this character(n) number and add n-1 from the right. Combining the part up to the character and the prefix text and writing to the block geometric point. The way this code works now is to combine the front text and the text to the right of the "-" sign of the last layer added to the layer list and write it to the center of the block. This wasn't something I wanted. (setq *textHeight* 8) (setq *layerName* "01 Equipment list 2") (setq *textColor* 1) ; (defun c:bs_ayar () (setq *textHeight* (getreal "\nEnter new text height: ")) (setq *layerName* (getstring "\nEnter new layer name: ")) (setq *textColor* (getint "\nEnter new color index (1 for Magenta): ")) (princ (strcat "\nText height is now " (rtos *textHeight*) ", layer name is " *layerName* ", color is " (itoa *textColor*) " was set to. ")) (princ) ) (defun c:bs4 () (setq prefix (getstring T "\nEnter prefix letter: ")) (setq blk (car (entsel "\nSelect Block: "))) (setq blkEnt (entget blk)) (setq insPt (cdr (assoc 10 blkEnt))) (setq ss (ssget "_X" (list (cons 0 "LINE,POLYLINE")))) (if (and ss (> (sslength ss) 0)) (progn (setq line (ssname ss 0)) (setq lineEnt (entget line)) (setq lineLayer (cdr (assoc 8 lineEnt))) (setq dashPos (vl-string-search "-" lineLayer)) (if dashPos (setq rightPart (substr lineLayer (+ dashPos 2))) (setq rightPart lineLayer) ) (command "._-LAYER" "_M" *layerName* "" "_C" *textColor* "" "") (command "._TEXT" insPt *textHeight* "" (strcat prefix rightPart)) (command "._-LAYER" "_S" *layerName* "") ) (princ "\nNo line or polyline was found touching the selected block.") ) (princ) )-
- intersecting
- line
-
(and 2 more)
Tagged with:
-
Hello guys, would like to ask for your help that I'd like to have a lisp that can let me extract data from multiple lines which then the data can be exported into a txt file. Would like to export the angle of the line ( the angle extracted should be in the form of degree minute second), the distance and also the end point coordinate( Y & X) in this order. Thank you very much. I am struggling with this problem!
-
Autolisp giving error: bad argument type: "LINE" when trying to get line type
Erroreki posted a topic in AutoLISP, Visual LISP & DCL
Hi! Avid reader of the forums, first time poster. I have a code with which I'm trying to extract the x and y coordinate of the startpoint of a line to the clipboard for pasting into another program. The problem is that when I run the lisp in Civil 3D it spits out when running (caddr typelst) on line 6 in the code below. What could cause this. I'm having trouble understanding why it wouldn't be able to grab the type from the list. The code: (vl-load-com) (defun c:copyx1y1 () (setq choice (entsel "Choose the line whose start X and Y you want to copy \n")) (setq entname (car choice)) (setq typelst (assoc 0 (entget entname))) (if (= (caddr typelst) "LINE") (progn (setq startpnt (assoc 10 (entget entname))) (setq x1 (cadr startpnt)) (princ "\n") (princ x1) (princ "\n") (setq y1 (caddr startpnt)) (princ y1) (setq copiedtxt (strcat (rtos x1) "\t" (rtos y1))) (setq result (vlax-invoke (vlax-get (vlax-get (setq htmlfile (vlax-create-object "htmlfile")) 'ParentWindow) 'ClipBoardData) 'SetData "Text" copiedtxt) ) (vlax-release-object htmlfile) copiedtxt ) (progn (princ "The choice is not of type LINE") ) ) (princ) ) Regards, E -
-
Hi guys, I just started learn civil 3d and I have question related to this. I have created parcels and I want change line label values metre to feet and inches. Is there any options in civil 3d ?. Waiting for valuable replies
-
lisp Move and Snap point to a 3D line in Z plane
Meenu posted a topic in AutoLISP, Visual LISP & DCL
Hi, I have a point on a 3D line's exact alignment , although the Z value of the point is 0. Can anyone help me with a lisp program to snap this point on the 3D line thus acquiring z value of the point. I have around 20000 points like this that need to be snapped and z value to be extracted. Thanks in advance. -
Line / polyline length to clipboard after selection
MP7 posted a topic in AutoLISP, Visual LISP & DCL
Hello guys, anyone knows if there is a lisp that copies a line or polyline length automatically to clipboard after selecting it? I have A LOT of polylines and I have to insert their lengths into a table, it's a bit of a pain in the ass having to write every single length, just select paste select paste seems faster right? :) Thx. -
Intersections Between Lines at different Elevations
Jaru posted a topic in AutoLISP, Visual LISP & DCL
Hi There is a situation what I need is a lisp routine or vba script to find the elevations between lines or polylines at the intersection points of them to better reflect my query I post an image. I thank you in advance for the help provided. Elevation-Case.bmp -
Dear friends, how long I was here!... I need some help, if someone knows any lisp to convert Lines in 3D to 3D Polylines. The goal about it is to do a Pipeline tubes in 3D way. Thanks a lot for any help. CafeJr...
-
Move several blocks until they hit in a line or polyline
Elves posted a topic in AutoLISP, Visual LISP & DCL
I need a lisp to move several blocks until they hit in a line or polyline. This line or polyline work like a boundary. Every bloks will end in the same X or Y axis. See result in a attached image. Thanks -
I'm trying to write a VBA code that searches in a general drawing all lines that have a specific length and slope. Then, every time it finds that line in the drawing, it will write next to a specific text, for example "line". Do you think it's possibile? Any idea? Thanks
-
Hello everybody I do drawings that have to have call outs. However, sometimes the call out line crosses with lines of the drawing so every call out line has to have an offset of .025, this way, the line only touches the item im calling. Currently, I do an outside offset on the line both ways, then I use trim and cut everything inside. Sometimes my figures have up to 50 call outs and I have to do this process that is very time consuming. Is there a way I could to this faster? I thought maybe i could put a blank line below my callout line, that had the width of the offset. Or maybe two blank rectangles that had the space of the line between them. I'm new in AutoCad and I'm having some trouble trying to solve this. Note. I copy and paste my drawings to word with paste special Picture (Windows Metafile) so it has to look the same as autocad. Example. Last picture is the result I need.
-
Create a line with Corresponding Dimension
ivanfrancis posted a topic in AutoLISP, Visual LISP & DCL
Hi, I was wondering if i could use two commands, line and dimlinear, in a single lisp file. this one i have measures a line you set with two points and creates a line that is a 1/3 in length of the distance between the two points. I want to add dimension line that will be 500 units above the created line. Any help would be very much appreciated. Thank you in advance. (defun c:aa () (setq po1 (getpoint "Pick first point:") po2 (getpoint po1 "Pick second point:") le (/ (distance po1 po2) 3) po3 (polar po1 (angle po1 po2) le)) (entmake (list '(0 . "LINE") (cons 10 po1) (cons 11 po3))) ) -
Convert spline to line
gegenytibor posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Dear All, Do you have any idea how can I convert this type of spline to a "normal" line? I think I get it from Inventor or Mechanical... I cant explode or extend, or add chamfer. Totaly useless! Please help if you can! Thank You! T line.dwg- 3 replies
-
- mechanical
- line
-
(and 3 more)
Tagged with:
-
Is there a command or a LISP (I have checked out LEE's but to no avail from what I found) that I can run say that will allow me to select text and then select a line and it be parallel with it? I know the command TEXT ALIGN but this doens't do what I am looking for, that, or I just don't know how to properly run the command? Any who, as always, thank you for any and all input. Miller
-
Is there any snap object mode to draw a line between two circles?
khoshravan posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
What is nearest as object snap mode and where it will be useful to use it? -
I have a number of large files that have multiple layers with many simple objects. I wish to have a LISP program that searches the file and for certain layers, it looks for line and arcs that have the same start or end points I.E. a line has one end point that matches an arc or another line start point. Once it has found these, it converts the lines or arc into polylines and joins them together. I have a number of squares or rectangles that are constructed from simple lines and I want to end up with a closed polyline that is the same size as the original rectangle. This could also be an odd shape comprised of arcs and lines that is either open of a closed shape. I wont to convert these to polylines also (either open or closed depending on if the lines are enclosed or open). Can anyone suggest how to write this. I have very little experience of LISP.
-
Hi very new to Autocad here - I've just downloaded Autocad onto my laptop, but my laptops number keys don't work so I am using my online keyboard viewer for numbers. When drawing in Autocad and putting in dimensions, is it possible to do it with an online keyboard? Because everytime I want to type in a number in the command section, I have to move my arrow to the on screen keyboard and select the numbers and this makes the line move aswell. Any suggestions??
-
Select every line in drawing and convert to polyline
GISdude posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
Hi all, I thought there might be an intuitive/simple way to do this. I've tried the lisp routine SSX, BUT when you run the routine you can't "keep" the selection to use the PEDIT command. Is there something I'm missing here? -
Using the line command to measure
CDM-ARCH posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
To find out the length of things in CAD I just use my line command and a distance box would appear above the line but no longer does. does anyone know how to get it back? -
03-26-2016 04:58 PM Hello, I'm doing a project for school and here are the starting directions: "The point of beginning (POB) of this survey is measured from BM#8332. This benchmark is located at the northeast corner of the intersection of SW Washington Street and SW Oleson Road. The coordinates for the benchmark are 1421334.93,783207.62. The first point in the survey for Oleson Village (the POB) is 113.66 feet from the benchmark and at a bearing of N5‹2723W. Note the general location of these points in Figure 2." So here's my issue. I'm trying to draw a line from the benchmark of "1421334.93,783207.62", but the line won't stick to that first point. If I start a line at 1,1, it will stick. If I start a line at 1000,1000, it will stick. Even if I knock off the last digit of each number before the decimal point "142133.93,78320.62", it will stick. Why is this? My limits are set to 2000000,2000000. I'm lost. This is scary becasue I havn't even started the project yet and I've spent 2 hours trying to figure this out. Any help would be much appreciated! Thanks in advance. PS. I attached the project. R, James Final Project.pdf
- 23 replies
-
- line
- first point
-
(and 1 more)
Tagged with:
-
Hello, I am having issues finding the location to set the default table style for a line/curve table. Any help is appreciated! thanks, phil
-
Hi, I was wondering if someone could help me out with the attached lisp file. My company likes to show the storm drain in our base with 4 different lines. One line for the centerline with a global width of zero with linetype continuous that would be on layer A, a polyline for the centerline with a global width of whatever size the pipe is with dashed2 linetype on layer B. The other two lines will offset half the distance of the pipe size from the centerline and will be continuous on layer B. The way the lisp currently works is it Converts selection set of Lines, Polylines, LWPolylines, and Arcs to sets of triple parallel polylines. Outer polylines have zero width and CONTINUOUS line type, while inner polyline uses Dashed2 linetype with user-selected width. I would like it for it does not change the original line i drew but instead copies and changes it to whatever my current layer is and offset it half the size of the pipe to both sides and than changes it to to a polyline with the global width of the pipe size and dashed2. I would appreciate any help. strmpipe.lsp
-
Underlining a single line text
musasiojw posted a topic in AutoCAD 2D Drafting, Object Properties & Interface
How can i underline a single-line text in AutoCAD 2014? -
Enter a Donut at two ends of a line. Please Help! Appreciated!
tmelancon posted a topic in AutoLISP, Visual LISP & DCL
I really need a lisp to find the ends of the lines then offset from those ends by [.25] and insert a solid "donut" at the ends of a line or multiple lines. I have the donut lisp we are currently using as well as another lisp I found on the web that is verrrrrry close to what I am needing. See below for the lisp and pics of what the current code does and what I am looking for. THANKS IN ADVANCE to everyone in the forums, your help is greatly appreciated! Here is the Solid Donut command I use. We call them bb's. (defun c:bb () (command "donut" "0" ".0670")(PRINC)) Here is the lisp I found that is sort of close. Courtesy of KENT1COOPER via AutoDesk Forums: (DEFUN C:CMARK (/ CRAD SS LN) (SETQ CRAD 0.0335) (SETQ SS (SSGET "X" '((0 . "LINE")))) (REPEAT (SSLENGTH SS) (SETQ LN (ENTGET (SSNAME SS 0))) (ENTMAKE (LIST '(0 . "CIRCLE") (ASSOC 10 LN) (CONS 40 CRAD) ) ) (ENTMAKE (LIST '(0 . "CIRCLE") (CONS 10 (CDR (ASSOC 11 LN))) (CONS 40 CRAD) ) ) (SSDEL (SSNAME SS 0) SS) ) ) current routine: new routine: (what I would like to try and get it to do)