AutoCAD Visual LISP / AutoLISP :: Attributes Contained Within A PolyLine

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


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Assigning Attributes To Blocks Using Polyline To Sequence Order

Sep 4, 2011

Any routine that will allow to draw a polyline through existing blocks, in the order the blocks should be numbered? Therefore when the sequence has been specified by the polyline then user to define the number system required, and the blocks are automatically numbered in the sequence of the polyine start to finish.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Reduce Polyline With Multiple Vertices To Single Polyline

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

AutoCAD Visual LISP / AutoLISP :: 3D Polyline To Polyline To Spline With Max

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

AutoCAD Visual LISP / AutoLISP :: How Not To Rotate Attributes

Nov 18, 2011

I have this snippet that inserts a block “Exit_Arrow”.  The block has one attribute. Is it possible to force the attribute to remain at “0” rotation regardless what angle the bock is rotated?

(defun C:Exit_Arrow (/ LA DS)
(setq LA (getvar "clayer"))
(setq DS (getvar "dimscale"))
(C:TTEXT)
(command "._insert" " Exit_Arrow " pause DS "")
(setvar "clayer" LA)
(princ))

Is it possible to create blocks whose attributes remain at "0" rotation regardless the host block's rotation?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Substituting Attributes

May 16, 2013

I isolated 3 attributes as you can see with my code.  My object is too take the value of blkDESC1 and set it as blktag, and then take blkDESC2 and set it as blkDESC1, and erase blkDESC2. 

(defun c:aup (/ dxf ent dxf1 ent1) (defun dxf (code ent) (cdr (assoc code (entget ent))))
(progn    (if  (and (setq ent (car (entsel "
Select an Attributed Block: ")))
(eq "INSERT" (dxf 0 ent))     
[code]........

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Get Enames Of Each Polyline

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

AutoCAD Visual LISP / AutoLISP :: Sum Of Polyline Lengths

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

AutoCAD Visual LISP / AutoLISP :: Change Z Value Only On 3D Polyline

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

AutoCAD Visual LISP / AutoLISP :: Set Polyline Elevation

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

AutoCAD Visual LISP / AutoLISP :: Region To Polyline

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

AutoCAD Visual LISP / AutoLISP :: Edit Attributes Of A Block

Aug 6, 2013

I have a block named "WD_MLRH". There are 3 specific attributes which I want to change in it. The attribute names are.

RUNGCNT, RUNGDIST and RUNGFIRST.
RUNGCNT will = 20
RUNGDIST will = 1.0 (or 1 will suffice)
RUNGFIRST will be decided by a user input.

Something along the lines of...

(setq RUNGFIRST (getint "Enter first rung number: "))

I'm sure this is completely wrong, but i hope that portray what I'm trying to accomplish.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting Blocks With Attributes

Jan 5, 2012

I've been trying tons of different solutions to solve this problem: insert a block that has an attribute which happens  to be the last object id.

This is the best code I tried so far but without any succss.

(defun c:q1()
(command "_.PLINE")
(while (= (getvar "CMDNAMES") "PLINE")
(command pause)
[Code] .....

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert All Attributes To Layer 0

Sep 12, 2013

I have searched the web and the Autodesk Discussion Group for a LISP Routine that allows me to convert all attributes in a drawing to Layer 0 but i have had no luck.  It would be great if the LISP could edit xrefs as well although not sure if this is possible.

**BATTMAN command will take too long for the hundreds of blocks, xrefs and drawings i need to edit.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Divide With Blocks And Keep Attributes?

Mar 1, 2013

I need a function that will allow me to do a "divide" with blocks but I need the single attribute to remain intact.

I need the blocks to align with object and keep the attribute. I did get it to work with constants but the function that I need to run next failed because of the constant. My variable is preset and locked.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Window Selection Of Attributes

Oct 16, 2012

I downloaded a lisp routine that will align block attributes. The problem is I can only select the attributes one at a time. I'd like to be able select multiple attributes using the selection window or a crossing window, but I haven't had much luck. If you use the AEATTSHOW command, it give you a prompt to "select using window" by pressing W. I'd like to have the same functionality for my Align attributes routine.

Below is the portion of code I currently have to select attributes one at a time:

;* Select all attributes to align with the parent selected above and add the attribute entname and the block
;* entname to a list in format ( (AttrEntName BlkEntName) (AttrEntName BlkEntName) (AttrEntName BlkEntName) )
;*
while (/= TempAttr nil)
(setq
TempAttr (nentsel "
Select Attributes to align: ")

[Code] .........

View 5 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 :: Polyline Width And Fillet

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

AutoCAD Visual LISP / AutoLISP :: Labeling Polyline Areas

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

AutoCAD Visual LISP / AutoLISP :: Divide And Measure Between Polyline

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

AutoCAD Visual LISP / AutoLISP :: Arcs To A Segmented Polyline?

Apr 17, 2012

i.e. one that would apply best fit lines and arcs to a segmented polyline?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Vertices Of A Polyline Segment

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

AutoCAD Visual LISP / AutoLISP :: Curve From Polyline Segments

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

AutoCAD Visual LISP / AutoLISP :: Ribbon Polyline Command

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

AutoCAD Visual LISP / AutoLISP :: Round Down Area Of Polyline

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

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 :: How To Create Arc Polyline With Entmake

Jan 4, 2013

I have run into a little trouble in trying to figure out how to create a arc polyline with entmake. I've put together the following and it works great with command "pline". I just want to know how to do it with entmake.

(defun C:22 ()
(setq P1 (getpoint "
Specify first point: ")
P2 (getpoint P1 "
Specify next point: "))
[code].......  

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Block - Add Attributes Automatically

Nov 3, 2013

How I can modify this code to create a block, ask for a new name for the block, then add the attributes listed inside the code below to the new created block. The lisp does a wonderful job - however, it only works if you already have a block created. We are in the process of drawing components and making blocks one by one, so it makes sense to add the attributes automatically when the block is created. We currently have over 500 components to create as a block and set the attributes to each one by one. 

Also I would like to know, If Fields can be used inside the lisp routine. That way we can always have access to the attributes from outside the block and change values for all the blocks at once.

(defun c:addattribs ( / blk def ) (while (not (or (= "" (setq blk (getstring t "
Name of block to update: "))) (tblsearch "BLOCK" blk) ) ) (princ (strcat "
Block "" blk "" not found.")) ) (if (/= "" blk) (progn (setq def (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) blk)) (vla-addattribute def (getvar 'textsize) acattributemodelockposition "New Attribute 1" (vlax-3D-point 0 0) "NEW_TAG1" "New Value 1" ) (vla-addattribute def (getvar 'textsize) acattributemodelockposition "New Attribute 2" (vlax-3D-point 0 (- (* 1.5 (getvar 'textsize)))) "NEW_TAG2" "New Value 2" ) (command "_.attsync" "_N" blk) ) ) (princ))(vl-load-com) (princ) 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Working With Multiple Attributes Within Block?

Aug 8, 2012

I know how to retrieve the entity information from the block, but can't figure out how to write the loop statement to loop, look for first attribute, assign to a variable, goto next attribute, assign to different variable, etc., etc...

In my research, most programs I've seen it execute the loop, assign to a variable, then print/put that data somewhere, loop again and utilize the same variable to print/put the next data somewhere. 

I would like each attribute within a block to be assigned a separate variable.

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Looping Through Attributes And Store Values?

Mar 19, 2013

I have an interesting challenge. I am tasked with updating old drawings. The only difficulty that I've run into with the old files are that the TitleBlocks are all done with all of the attributes are named "SPEC". There are 90 attributes. I'm really struggling with getting each attribute's value and then storing the value to a variable so that I can then put that value into a new TitleBlock. The old TB will be deleted to avoid future confusion in the file.

(To clearify, the old TitleBlock is in model space, while there are actually nine new TitleBlocks all in seperate paper space Layouts, and this program may have to run on hundreds of files.)

getting the values from the Old TB. I need them in order of first to last or last to first (either way will work since I have the variable names in a list that can be reversed if necessary.) 

simple function to read through the block's attributes in order and store the attribute's value to a variable name in the seperate list (also in order)?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 2014 - Insert Block With Attributes

May 21, 2013

I am testing de new version of autocad 2014 and i have a problem with lisp.

when i use (command "_insert" "block1" pt1 "" "" "" obj1 ).

The block is inserted but without value. In the old version work.Some variable that has to change?

View 3 Replies View Related







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