AutoCAD Visual LISP / AutoLISP :: Polyline Offset Trim And Erase?
Oct 8, 2013
I've been looking for a lisp program. I've tried to mix-and-match code to come up with a working lisp but nothing is working. I am using a polyline rectangle to start with, offsetting it out 0.75 outward, and triming everything outside of the offset and erasing the offset.
View 9 Replies
ADVERTISEMENT
Feb 18, 2013
Wblock when run from the command line used to erase the entities selected, now it seems it does not, but the dialog box shows an option to keep or erase the selected entities.
Any variable name that controls this functionality?
View 1 Replies
View Related
Jun 7, 2012
I would like to take all the vertices out of a multiple-vertices polyline so that it reduces to just its start and end points, can this be done?
View 4 Replies
View Related
Sep 21, 2013
Due to modeling purposes, I need to convert a 3D polyline to a spline. What I have been doing is:
- change polyline fit/smooth to cubic from properties
- convert polyline to spline by typing spline -> object
- method -> fit from properties
You can see the original 3D polyline (green) and the resulting spline (magenta) in the attached drawing.When I zoom in and measure the distance between the two entities at different points along them, at some points the perpendicular distance exceeds 5 millimeters, and I want to ensure the deviation remains under 1 millimeter or even less.
I know I can change the knot parameterization of the spline, and this does work at some locations, but the difference increases at others.Why is there a 5.6 mm difference between the spline fit point and 3D polyline vertex, as measure in the attached drawing?
Now, I can go and manually stretch the fit point to coincide with the vertex. Also, I can add fit points between existing ones to drag the spline closer to the original 3D poly.
However, some of my polys are really long, and it is very time-consuming to do this manually while measuring points along the entities to make sure the distance stays small enough.
how to automate this process? For example a lisp that would maybe take the original vertex points, add say maybe 3 (not too many) new ones between them, and then generate a spline while making sure the deviation is less than the set value of 1mm? I am using AutoCAD 2013.
View 5 Replies
View Related
May 15, 2013
I have pieced this lisp together from a few I have come across here in the groups, but am now stuck with the final pieces. Once the pline is drawn I would like the lisp routine to select the pline (last ?) instead of the user doing so. I would then like to offset the line 1 (foot) and then erase the original line drawn, so the user does not have to.
View 9 Replies
View Related
Apr 9, 2013
I have a lisp which I use to erase all points in a specific layer.
(defun cPL ()
(setq ss1 (ssget "x" (list '(0 . "point")'(8 . "Points"))))
(command ".erase" ss1 "")
(princ)
)
It is working only if I have the points in the DWG. If there are no points, I receive "Unknow command DPL". Is there anything I can do in order to avoid this error?
View 5 Replies
View Related
Jul 15, 2013
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 Related
Feb 2, 2013
I need a program to trim selected text(s) with a divisor.
suppose that the divisor character is: "/"
(selected text==>result
textL/textR ==> textR
xxx/yyy ==>yyy
t12x/5678 ==>5678
I should use some commands like:
;;;;div="/":
(setq str "xxx/yyy")
(setq pos (vl-string-position (ascii "/") str))
(setq len (strlen str))
(setq RGT (substr str (+ pos 2) (-(- len pos)1))) ;;=text after "/"
but I need a LISP program that:
1-ask user to give a divisor char: (Divisor character: </>)
2-ask user to select text(s) but program should filter selected text(s) with divisor (*/* pattern)
(if (null #div#)(setq #div# "/"))
(if (and
(setq #div# if (= (setq tmp (getstring (strcat "
Divisor character: <" #div# "> ") ) ) "" ) #div# tmp ) )
(setq ss (ssget "_:L" (list '(0 . "*TEXT") (cons 1 (strcat "*" #div# "*")))))
)
View 5 Replies
View Related
Sep 6, 2013
There are many lisp that draw offset line but what about opposite way , I have wall of double line i need to delete one of them let's say inside wall line .
why i need to do this usually when i tracing in external program like autocad architecture or Revit or archicad i just need outline of exterior and interior walls !.
is there way that can delete the offset line ?(or within range predefined in lisp to prevent interfering of lines deletion).
View 5 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
May 8, 2013
I want to know the correct way to find the offset origin of a layout in an AutoCAD drawing. Let say I have a drawing that has many items on it. And I create a layout showing just the items in the lower right corner of the drawing. I want to know the offset origin of this layout relative to the Model space.
I came across some LISP commands that are supposed to do just that:
(vl-load-com)(setq activelayout (vlax-get (vla-Get-ActiveDocument (vlax-Get-Acad-Object)) 'ActiveLayout ))(setq activeplotorig (vlax-get activelayout 'PlotOrigin))
Unfortunately, the commands don't seem to work because it always returns (0.0 0.0). That cannot be right.
View 1 Replies
View Related
Jan 25, 2013
I wish to have a lisp than enable to do automatic offset base on some selection of lines ,circles or polylines object as shown in attachment.
View 9 Replies
View Related
May 6, 2013
I am a beginner at LISP and this is a bit out of my league... and I'm trying to create a lisp where I can draw a polyline between 2 points that also places text with the actual distance offset above the line.
I did find this post and I'm not quite catching on.. [URL] ......
View 9 Replies
View Related
Sep 27, 2013
what I am attempting -
Pick a line
Pick a starting point on the line
Pick a ending point on the line
Pick side to offset
create list of offset points
Create a new line with a offset
I think I could do this using brute force, but would prefer a mathematical solution.
View 9 Replies
View Related
Feb 29, 2012
I'm trying to complete the code to select a p-line on layer G-POLY-GSF w/o asking for input. this (setq ent (ssget "X" (list (cons 8 "G-POLY-GSF"))) dosen't seem to work. What I'm I missing here?
(defun cf8 (/ ent dist obj)
(vl-load-com)
(setq ent (car (entsel "
Select line to offset: "))
;(setq ent (ssget "X" (list (cons 8 "G-POLY-GSF")))
[Code]....
View 8 Replies
View Related
Apr 26, 2013
this is a Offset cutting plane line I want it to be all polylines but I can't get the ename of the end points of the polylines dose anyony know how
(defun ccp (/ pt2)
(SETVAR "CMDECHO" 0)
(setvar "angbase" 0)
(setvar "angdir" 0)
(command "polarang" 1)
(setq pt1 (getpoint "
[Code]....
View 9 Replies
View Related
May 21, 2012
Is it possible to determine the sum of the lengths of all of the polylines on a certain layer? I'm trying to determine the total length of joint sealant on a building's exterior.
View 8 Replies
View Related
Aug 23, 2012
I am using acad 2010. I have a contour generator that uses 3d polylines to make contours. I get depressions or tops where I don't want them. I need a lisp routine that will allow me to adjust the z value only on any 3d polyline. I need to raise or lower the z value at any vertex and repeat if necessary. I don't need to prompt the user- I am the user.
View 2 Replies
View Related
Jul 19, 2013
I create contour line in TOPOGRAPH program, and I import these polylines to AUTOCAD. I have to set elevation for each polyline manually, and I waste a lot of time doing that.
So looking for lisp doing that automatically. I mean, invoke the command, set the first elevation and them select the polylines.
e.g. The first elevation is 530. The next polyline that I select is 531 and so on.
View 3 Replies
View Related
Feb 17, 2009
For the sake of editing, I sometimes make LWPOLYLINES and convert them to regions so that I can union and subtract and intersect, etc.
then sometimes, like now, I want to work with them like as LWPOLYLINES again.
is there some command I don't know, or some routine or shall I make one?
View 8 Replies
View Related
Jun 7, 2012
I posted a version of the Offset command that lets you Undo individual Offsets and change the offset distance/Through option, without getting out of the command, at Cadalyst CAD Tips: URL....
It's an upgraded version of an earlier concept by Gopal Ramesh. It's been downloaded almost three times every day since it went up, so I guess people expect it will be useful.
But the website's description includes: "this routine does not provide access to the Layer or Erase options of the built-in Offset command." The reason for that is that I'm working back in 2004, so those options are not present for me to emulate. [The Undo option in the routine is one that was added in some later version, but is a very useful enhancement for people using older versions, like me.]
I do also have an Offset-to-any-Layer [not just the source's or the current Layer] routine posted there: URL....
And I have a simple little routine to Offset something and Erase the source object. So I think I have all the "pieces" to include those options that newer versions have, but that I don't. I would like to combine the functionalities into the Offset-with-running-options routine. That way, if people want to use it to redefine the Offset command as I have done, in order to get the while-running distance change option, those working in newer versions won't be losing the Erase and Layer options in the process, and those in older versions will be gaining yet more options.
View 6 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
Feb 5, 2013
I've been searching on and off all morning for a lisp routine, without any luck. I'm trying to draw a pline with a pre determined width (5") and be able to draw unlimited line segments then automatically fillet with a pre determined radius (5").
I wrote this generic macro: ^C^CPLINEWID;5;PL;\\;FILLET;R;5;F;P;LAST; to save SOME time but I want unlimited line segments. Can this be modified or would a lisp be the better route to go?
View 3 Replies
View Related
May 4, 2011
Code below, for labeling polyline areas
It works great for what i want, with 2 exceptions the text is to small and the label is not inserted at the centroid of the polyline, rather it is placed outside the polyline.
i am able to increase the text style by adjusting the dimscale before i run the command, however it would be good if the program could do that automatically, i would like the text to be about 300 units high, and for the label to be placed at the centroid of the polyline
(defun C:AT ( / ss i)
View 9 Replies
View Related
Aug 1, 2012
do you know command or lisp that will do new pollyline between two polyline on 1/3 or 1/4 space between them.
I need sommething that would be faster,know is use measure on pollilines then i draw between horizontall polylines on verteks or point new pollyline and then divide it on 4 or 3 parts.
View 1 Replies
View Related
Apr 17, 2012
i.e. one that would apply best fit lines and arcs to a segmented polyline?
View 4 Replies
View Related
Dec 18, 2011
I have to intersect polylines "POLYLINE" and "LWPOLINE" with a line and get all the angles of all segments of the polyline that are intersected.
To do this I used a loop that monitors all the vertices of each polyline to find the two vertices of the polyline segment that intersects the line. Unfortunately, these polylines have thousands of vertices and the processing done in this way takes too long.
With the vlax-curve-getClosestPointTo I could very quickly find the vertex of the polyline closest to that intersected with the line, but I need to find the other vertex of the polyline segment to determine the angle of this.
Another question: is there a quick function that returns the exact point of intersection of two curves (e.g. A line and a polyline, or a line and a circle?
View 9 Replies
View Related
Apr 13, 2012
I´m looking for opportunities to can modify a polyline with 4 or more segments in a polyline with arc. I think it´s possible to pick start and end segment first and than all straight segments to will be in arc segments.
View 6 Replies
View Related
Jul 29, 2013
Creating a ribbon for Partial Customization files in the CUI, and I am trying to setup some buttons for existing polylines for example underground electric and overhead electric. When writing the macro what are some ideas for creating a polyline with the proper linetype for that particular object rather than changing the layer in layer properties dialogue.
View 9 Replies
View Related
May 8, 2013
I have a closed polyline that i can add the area to via a field in mtext using the options under area. I would like the area to always be rounded down to the nearest square meter. Is the a way to do this via the acfields.fdc file?
View 8 Replies
View Related
Oct 11, 2011
I have to go through quite a few drawings and extract the attribute vales of the whole drawing and then a subset contained within a couple of polylines.
The whole drawing is Ok as I can use at out or the data extraction, but its the ones contained within a polyline. How do I do that?
View 9 Replies
View Related