AutoCAD Visual LISP / AutoLISP :: How To Sensibly Extract Angular Dimensions As Attributes
May 14, 2012
how to sensibly extract angular dimensions as attributes.
I can extract the attributes from a block containing angular dimensions, the attributes list angular dimensions as a field but don't actually list the number of degrees for the angular dimension.
It is the number of degrees that I am actually trying to obtain - but I cannot work out how to obtain the information
View 3 Replies
ADVERTISEMENT
Dec 4, 2012
I was adding a lot of aligned dimensions to a drawing and some where along the way they changed from aligned dimensions to rotated dimensions, even in the same string of dimensions.
View 9 Replies
View Related
Jun 4, 2013
I need a lisp routine that will allow me to pick a polyline and label with azimuth and distance (direction-north, clockwise) of a new WCS.
Is there any code that extract information for a new WCS?
View 9 Replies
View Related
Nov 25, 2013
I have a drawing that has an aerial Images inserted into it using a WMS Connection How to extract Image Name through Autolisp from this
View 5 Replies
View Related
Oct 6, 2011
I am trying to write a lisp file that extracts the LAYER, Z, X, Y, TEXT HEIGHT, POINT NUMBER, from the attached DXF file. Ultimately I will have the lisp insert a "POINT" at the X,Y,Z, cords, and then a "TEXT" entity at the same coordinates with the text height value and the point number string. Both entities need to be on the layer ending in "-PN". The layer name will change depending on the date. I have a third party program that creates the DXF file.
The point of the lisp file is to insert the point numbers and points into my drawing at their correct locations. For the life of me I can not make this work. I have attached the little bit of lisp I have, which unfortunately does not work properly because of it searching for the "TEXT" entry in the DXF file of which there are three per point number. I only need one. I have also attached the DXF file I have. maybe just an overall procedure that I can then code myself? I'm just not good at getting lisp to read a file and extract what I want from it.
View 4 Replies
View Related
Sep 18, 2000
I would like a lisp routine that can extract and export the x, y, z coordinates of all the points in a drawing into a text file so I can use the same in excel.
View 9 Replies
View Related
Aug 17, 2012
I’m looking to extract the second from the last directory within the dwgprefix of
"P:Projects66 Structural666-4800-00 TPA666-4815-00 Res4815 Res Figures" (i.e. 666-4815-00 Res)
This is what I have so far:
(defun c:tmp ( )
(setq P1 (getpoint "
Pick point: "))
(command "text" P1 "" ""
(strcat
(vl-filename-base
(vl-string-subst "." "\" (getvar 'dwgprefix) (vl-string-position (ascii "\") (getvar 'dwgprefix) nil T))
))))
View 9 Replies
View Related
May 28, 2013
A quick lisp routine to extract the elevations of a selection set of 2d polylines? I have a massive "contour" file composed of 2d polylines with elevations. I need to find the min and max polyline elevation in selected areas. I can't figure out how to extract just the elevations of my selected polylines so I can quickly see the elevation values?
View 9 Replies
View Related
Sep 12, 2013
I've got a linetype that's part of our autocad template file and has been for so long that nobody around here even knows where the original line file is.
I need to extract the linetype out so that I can make some minor modifications. I did do a search and found a nifty lsp routine from Paul Turvill. (Here's the thread that pointed me there: [URL] ..........
I ran it and it SEEMED to work. All the linetypes in the file it created look good EXCEPT for the one I needed to extract. That one looks like this in the line file:
*TREELINE,Series of arcs used to indicate tree drip lines
A,0.0001,-0.0001,
The linetype DOES display properly in the dwg file (meaning lines drawn using it look good).
View 5 Replies
View Related
Jan 3, 2012
how to extract value X Y Z of point p3 p4
(defun c:test ()
(vl-load-com)
(setq actdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq objm (vla-get-ModelSpace actdoc))
(setq obju (vla-get-Utility actdoc))
(setq oldhigh (getvar "Highlight") oldsnap (getvar "Osmode") oldblip (getvar "BlipMode") oldecho (getvar "Cmdecho") );setq
(setvar "Highlight" 0) (setvar "Osmode" 517) (setvar "Cmdecho" 0) (setvar "Blipmode" 0)
[code]....
View 4 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
Aug 16, 2012
I'm dimensioning an old drawing with the real (measured) dimensions and with the drawing dimensions in brackets (using ' 1500 (<>)' to give '1500 (1505)' for example.
What I'd like is to also be able to put on the difference between the length I type in and the length in brackets - as this would let me see any really glaring errors that can't be attributed to user-error on the laser measure.So I could type in '1500 (<>) (X)' where X is the formula, and get ' 1500 (1505) (5)' back?
How to be able to run a script that could highlight any dimensions where the number is brackets and the typed number have a a difference of, say, 50.Or failing that, any way to extract all the dimension text at the end into excel so I can see the differences myself?
View 1 Replies
View Related
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
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
Mar 8, 2012
Is that possible to have a lisp to extract the Field Expression of a attribute in a block?Specifically, to extract the property VALUE (TextString) of this attribute.After to extract, I would like to put this text extracted in a different layout tab, in the same drawing. In this way, I will have a text linked to the attribute value between two layout tabs. So, when I have to change the attribute value, the text will be updated automatically.
I know that if I use the FIELD command to manually copy and paste this value it will work, but when I have a lot of attributes it becomes very laborious.
View 9 Replies
View Related
Jul 23, 2013
I design a small plant in Autocad 2012. For the pipes we used cylinders and boxes(for square pipe), now we need to make the bill of materials, but I don't know how to extract the data from each cylinder(radius and height) or box.
It is possible to do this?
I place a small sample from the plant. Totally I am having around 6000 elements.
View 9 Replies
View Related
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
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
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
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
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
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
Mar 5, 2012
How can I extract all layers in an open drawing to a notepad or txt file?
View 7 Replies
View Related
Sep 15, 2011
I was wondering if it was the COND statement that I would need to use to evaluate a block to confirm that two attribute tags existed and if so, if would process the block to perform an attribute extraction of both of those tags. It would ignore blocks that only had one or the other attribute tags - and only extract the attribute values if the block had BOTH of the tags present - It could be blank, but it had to exist.
For example, I want to find blocks that have the attribute tag "PART_A" and "ID" - and then create a CDF that has the value of "PART_A" in the first column and "ID" in the second column. Then it closes my CDF file.
Then, I want it to scan my drawing again for blocks that contain attribute tag "PART_B" and "ID" and then re-open that CDF file and append the values so that the values of teh attribute "PART_B" is in the first column and the values of the tag "ID" are in the second column.
I have been playing with the following code --- is there anyway to modify the code to get it to do what I need? I have already removed the part that writes the header-row....
View 1 Replies
View Related
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
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
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
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
Oct 15, 2013
How i can filter attributes string value.
How i set the layer name is = attributes string value.
Example:
A attributes string value is R8 .all these string is set the layer name is same string value(R8).
View 1 Replies
View Related
May 9, 2013
I have 40 pages in one set of drawings and would like to rev-up the drawings. i will put same texts in same locations in the title blocks.
View 9 Replies
View Related
Sep 5, 2013
I'm using a blocklibrary, where I stored all my blocks, most of them have attributes.
Now I'd like to simplify my workflow and want to update the blocks that I inserted in a drawing trough LISP.
Is there a way to update all inserted blocks and attributes of the whole drawing a once? The idea is, that the LISP checks the whole blocklibrary and updates the inserted blocks that to not match with the once from the library.
View 9 Replies
View Related