AutoCAD Visual LISP / AutoLISP :: Burst All Blocks With Text / Attributes Inside

Apr 4, 2013

I need a lisp code to burst all "blocks with text/attributes inside" in selected area. That means user should select an area (window selection) and lisp program should be find all blocks with TEXT or ATTRIB inside in selected area and then applys "BURST express tools" command to all these blocks in the selected area by user.

View 9 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Express Tool Burst - Invisible Attributes Now Visible

Oct 30, 2005

When using the express tool Burst, Invisible attributes are now visible. How does one modify the routine so that the invisible attributes are deleted.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Flatten Inside Blocks

Apr 17, 2012

I wanted to flatten arcs, circles and lines inside a block using the following lisp (which I found in this forum). I found that sometimes this lisp is unable to flatten the ARCs inside the blocks. I do not understand why it is not working for all the blocks. I have attached a drawing in which this lisp is not working.

(defun c:FlattenRaj ( / blocks stpt enpt inspt )
(vl-load-com)
(setq blocks
(vla-get-blocks
(vla-get-activedocument
[code].......

View 1 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 :: 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 :: Update Inserted Blocks / Attributes

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

AutoCAD Visual LISP / AutoLISP :: Change Multiple Blocks Attributes

Feb 27, 2013

We wanted to automatically fill a block's attributes from a selection in Excel. I have a piece of code that has the user select/pick a block to fill. What I want is for the selection to fill multiple blocks in an active drawing. Some of the blocks are the same - which means the same tags/attributes. I've included the code that allows the user to select the block and throws the Excel selection to certain attributes.change the code so that

1) I don't have to manually select blocks - it will find them.

2) One cell (from Excel) will go to multiple blocks - some are same block name.

3) An IF statement that if a certain cell isn't blank/nil

(pretend it would be (nth 21 vl) change DESC11 to XYZ and DESC12 to ABC. For Block namesake we'll call one, BLOCK1 (say it has 3 instances and gets different info in each case) BLOCK2 (say it has 2 instances, also gets different info) BLOCK 3 AND 4 both have an attribute - DESCAA1 that gets different info from Excel.

(defun C:AUTOFCM (/*error* adoc attribs blkobj enExcelapp Sel Sht Rng vl Wbk ) (defun *error* (msg)(if adoc (vla-endundomark adoc)) (if (and msg(vl-positionmsg '("console break""Function cancelled" "quit / exit abort") ))(princ msg)(princ "Error!") ) gc) (princ) ) (or adoc (setq adoc (vla-get-activedocument (vlax-get-acad-object))) ) (vla-startundomark adoc) (alert "Select a range of cells in Excel.") (setq ExcelApp (vl-catch-all-apply (function(lambda ()vlax-get-or-create-object "Excel.Application") )) ) ) (if (vl-catch-all-error-p(setq Wbk(vl-catch-all-
[code]....

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Color Of Hatch Inside Blocks

Oct 2, 2013

I don't give the right keywords with Google !?So from a classic selection (or ALL for ALL Blocks of the DWG) of entities,

we will keep ONLY blocks (Static or Dynamic)I am looking for a Lisp/VLisp routine to update all Color of Hatches inside Blocks when the Hatch Color is xxx If the color hatch is NOT XXX we don't update !

The problem : update all hatch from blocks where Color = 255 (or any other value)

---> other classic Color (1-256)
--> RGB Color 255,255,255 or any other

I don't know at all how to switch hatch entities from classic color to RGB color inside a Block..And dynamic block in Lisp/VLisp are far from my level  0.2 in Lisp ...

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create Blocks With Some Of Attributes On Locked Layers

Jan 4, 2012

i am trying to restrict users from modifying certain attributes in a block,i can create the blocks with some of the attributes on locked layers, but then autocad pops up an annoying alert box, is there a way to disable this? the other option i can think of is to redefine the commands *ddedit, *attedit, *ddatte,*attipedit,

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Remove All Attributes Including In Nested Blocks?

Jan 8, 2013

There is a quick way to remove all attributes, including in nested blocks. Looking some lisp in the forum, I can't find one code for remove this elements completely.

View 9 Replies View Related

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 :: Automatically Export Attributes From Selected Blocks To Defined Txt File

Oct 3, 2012

How to create a lisp to automatically export attributes from selected blocks to defined txt file without having to everytime confirm the file name, location and if the file shall be replaced?

Meaning is that I often export attributes to txt file for further use. It is always the same file (I just overwrite it always).

The way I do it now is selecting blocks, using ATTOUT command, then going to the desktop, selecting ATT.txt file and confirming that it is to be replaced.

Is there a way to make lisp or script that will just do all it in at once?

I found on forum such a lisp as below, but it exports all ablocks on drawing and it exports to txt file which is located in same  place as drawing and with same name as drawing. Tried to modify it but without success:

(defun cut-att ()
(load "attout")
(setq fna (strcat (getvar "dwgprefix")
(acet-filename-path-remove (acet-filename-ext-remove (getvar "dwgname")))
".txt"
))
(setq ss (ssget "X" '((0 . "INSERT") (66 . 1))))
(bns_attout fna ss)
)

Same question for ATTIN - I use attin and always same file name from same location - how to automate it with one command?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create A Master List Of Construction Notes Then Use Blocks Attributes With Fields

Nov 16, 2012

I am looking for a way to create a master list of construction notes then use blocks attributes with fields to link to that master list. That way if the master list changed the note bubbles would change as well.

Sheet sets are being used with this project but I can't think of a way to make it work with the existing sheet set technology.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Patchwork Quilt To Burst Block By Name?

Sep 6, 2013

It's close... when I load it, however, instead of finding the block by name, it gives me "Select objects".  As soon as I pick the block it executes the burst.  But I can do that much without a program. 

(defun c:burev (/ ss old-echo item)
  (setq old-echo (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (if (setq ss (ssget "_x" '((0 . "INSERT")(2 . "E-REVTABLE"))))
(defun c:bu()
(c:burst)
)
(princ)

[code]....

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Changing Text Formatting Style Inside All Text Contents

Aug 4, 2013

I have inside every text,Mtext contents different text style like Arial_1 , Arial_2.

How i can give all the contents inside one style ? the normal procedure i will enter inside text to enter editing mode and changing text format style one by one. I  want it once.

I want to save my routing of entering every text to change its content text style.

(Notice:select all from outside without editing mode will not do the job)

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert Text To Attribute Inside Block

May 3, 2013

Looking for routine for converting text to attributes inside the block?

In my drawing I hv some attribute blocks having some Text in it. I need to change the Texts inside the blocks as Attribute Texts. I am attaching sample Blocks drawing..

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dynamic Blocks Visibility To Text?

Mar 16, 2012

I wonder if it is possible to have a routine that captures the visibility name of a dynamic block and place it in a text in the drawing?

For example, I have a block with 10 visibilities. I copied this block 10 times in the project and I put each one with a different visibility. Now I would like to make a label with the name of each visible state next to each block.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Routine To Substitute Text To Blocks At Point Location

Aug 17, 2012

i found this valuable script Lisp routine to insert blocks at point locations and want to modify it but i do not know much about lisp ...

what i want is :

1) script start and asks for a Block Name (in this case QPP1, QPP2, QS, QE, ect)

2) the user picks existing text  

3) the script reads the value existing on this text an put it in a variable

4) then erases the pre picked text

5) inserts the block chosen

6) changes block value to number value pre-read

since it do almost all steps except for step 3 and 6

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select All Blocks Like Selected Blocks With Window?

Feb 28, 2011

(defun CELBLKS ( / e blk ss blkl)
 (setq blkl ""  ss (ssadd))
 (while (setq e (entsel "

[Code]....

i have this lsp, it works great but how can modify it if i want select with a window.? exemple: if i have 3 differentes blocks, i want to select them with windows and the lisp select all blocks that are identical of those 3.?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Convert The Blocks In Dwg File To Lines That Are Centered On Those Blocks?

Jan 24, 2012

I have a project in 3D that I would like to export to Stadd.  This requires lines rather than blocks.  Is is possible to convert the blocks in the attached dwg file to to lines that are centered on those blocks?

View 9 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 :: 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 :: 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 :: 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 :: 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 View Related

AutoCAD Visual LISP / AutoLISP :: One Attribute At Two Different Locations Inside Of One Block

Aug 5, 2011

Is there a way (or a “trick”) to have one attribute at two different locations inside of one block (I want to avoid filling in the same text twice when this block is inserted or edited)?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: How To Modify Line Inside A Block

May 20, 2013

I have a simple block with 2 attribute and 1 line inside it.

something like this:

Attribute1

──────

Attribute2

I want to modify length of line due to width of thoes attributs. length of line is equal to maximum(width attribute1 and width attribute2).

dxf code for start point of a line is 10 and end point for a line entity is 11.The question is: how can I modify the length of line automatically via maximum width of these attributes?

for getting width of a text:

(defun GetWidth ( en ) ((lambda ( lst ) (- (caadr lst) (caar lst))) (textbox en)))
sample:

A1
──────                    
Attribute2

Attribute1
──────           
A2

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Redefine Block Inside Reactor

Dec 4, 2012

I have the following code to redefine a block after a command has ended:
 
(vl-load-com);*********************************************************(defun Redefine() (command "_.INSERT" "reactortest=reactortest" nil)(princ "Block redefined."));****************************************(vlr-command-reactor nil '((:vlr-commandEnded . endCommand)));******************************************************(defun endCommand (calling-reactor endcommandInfo / thecommandend) ; Get the name of the command.(setq thecommandend (nth 0 endcommandInfo)); Check name of the command.(cond ((= thecommandend "PLINE") (Redefine)));cond(princ));defun(princ)

It doesn't work because INSERT is an interactive function and can't be called while a reactor is active. Is there another way to redefine a block that can be used in a reactor? The block is in one of the default search path's.

View 2 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







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