Looking for starting point to writing a routine that will open blocks in a drawing and change the colour.We receive drawings from clients with their blocks and would like to have them changed to our company colours.
So basically, i am looking for something that would within a drawing, change every block to a specific color without exploding and redefining. The colour changes will be the same throughout new drawings.
I have been filtering through this descuession group for a whil this morning looking for what I need and have found somethings that are close but haven't managed to change them a little to do what I am wanting..
I have drawings with a block named UG101 and has been inserted on all sort of different layers.
What I would like to do is run a lisp routine that would select all blocks with the name UG101 and put them on the layer CableInfo.
I have many other blocks that i need to do the same to but with different names, so I was hoping, I could change the lisp routine around to do the rest of the blocks in the drawing..
wondering if is possible to have a lisp routine to:After use the INSERT command, the routine will automatically change the layer of the inserted block to a specific layer according of its name.
i.e.
Step 1 : I will insert a block named Block A using the normal autocad INSERT command (I do not want to insert the block without the Insert window dialog box)
Step 2 : After the insertion, the routine will select the last insertion (or the last object, or any other best way to select this block and will take it's name)
Step 3 : The routine has a list that says:
(If the last insertion (or object) is named Block A, put it in the layer Layer A with color Bylayer and linetype Bylayer)
(If the last insertion (or object) is named Block B, put it in the layer Layer B with color Bylayer and linetype Bylayer)
and so on... I can make the approprieated list by myself folowing my standards.
I think it will be nice to avoid an error if the block is not in the list. So:
(If the last insertion (or object) name is not in the list, do nothing)
To finish, it will be nice to create the layer if it does not exist. Also, Unlock, Thaw and Turn on the layer if it's Locked, Frozen or Off.
We are trying to update our company logo on hundreds of autocad drawings, any lisp routine or a better way to get this updated. We are trying to update our title blocks that have company logo in it and want to change the logos to the new one.
What I am trying to do is grab the value of the owner tag (of which there are four), and use that value to determine which layer to place it on. What it seems to be doing is hanging.
select all blocks on certain layers in a drawing, check attribute CIRCUIT in each block if it starts with MS then attribute CONTROL = switched. I hope thats clear enough the way
(defun c:control() (graphscr) (Setq sc (ssget "X" '((0 . "INSERT")
How to change the Scale Uniformly property in dynamic blocks accross hundreds of drawings using either/or scripts, lisp, vba or anything else that might do the job.
I just need to open the drawing and select the block (one block per drawing) then edit the scale uniformly property within the block, save then close the drawing and move onto the next drawing.
I get an AutoCAD drawing from my conveyor manufacturer who have buried a block (tagname) in all of their conveyor blocks.
The only way to remove them is to manually use BEDIT and erase the tagname block.
Is there a way through Autolisp to search all blocks in a drawings and if the tagname block is part of the definition of the conveyor block, erase the tagname block or redefine the conveyor block without the tagname block.
When dynamic blocks are inserted they're assigned an anonymous block name. I'd like to be able to retrieve the name of the parent block after selecting the block on screen using AutoLisp.
Create a routine that looks for a block based on a portion of that block name, using a specified path or search path.
For example, block to search for is BLOCKABC123, so if someone inputs ABC or 123 as a block name, it will locate that block within that folder and inserts it into the drawing at a user specified location.
Ideally, if there is a check in that if it finds more than one match, then perhaps it flags or prompts you to choose 1, 2, or 3 option which block to use. But I can live without this special function if it requires too much time to code.
I need to match few attribute values from one block to different block. I download a lisp file called; ca.lsp which can match the single attribute value. I modified it for more than one attribute value matching. It is ok but still wish to overcome two issues for batch prcess
1. picking up the blocks by selection
2. click the alternative block numbers of times to match the numbers of attribute values I needed.
How to modify this lisp I can run it by block name selections instead of picking selection which enable me to run batch process for numbers of drawing? That will be good...
Lisp & Demo file attached (Match attribute value, A, B & C to Attribute 1, 2 & 3).
I am learning autolips and i found a problem that i can´t solved.
(vl-load-com)(defun c:pmb ( / ss ent pt )(prompt " selec block : ")(setq ss (ssget '((0 . "INSERT")))) (setq ent (ssname ss 0)), (setq pt (cdr (assoc 10 (entget ent)))) (command "point" pt)) wich this code you select one block and insert one point at insert point´s block.
which this other code yo select all block and insert all point.... but in one block
I have a block that i want to insert several times and revised each one to be different to do this i would have to insert it and rename the blocks that come in and then reinsert i would like to insert and have a lisp explode the main block and rename the other 2 blocks with a suffix at the end depending on how many times its in the drawing... can this even be done? My original block name that will be first inserted is "BENT PULLEY NOTES" it needs to explode after i drop it in and then there are 2 blocks within that called "Bent Pulley" and "Bent Pulley DYN" that i was hoping to keep the names but add a number at the end depending on how many are in the drawing already...
here is a lisp that i have found... it would work if i didn't have nested blocks and only wanted the one block to be insert and not explode...
(defun c:Test (/ e i name Bname ) (setq e nil) (command "_.-insert" "Drawing1.dwg" pause "" "" "") (if (setq e (entlast))
I have a dwg with 40 blocks that have a non-annotative property. I can go through 1 by 1 and change the property to annotative and redefine the block. Is it possible to automate this? I have done some google searches but have not found anything I am able to cut and paste or put together to get it to work.
Civil 3D 2012 SP4.0 Windows 7 Enterprise 64-bit C3D 2014 SP1 Dell M6600, Core i7 @ 2.3GHz, 16 GB ram Dell T3500 workstation, too much ram to post
Lisp program, by selecting on screen multiple block attribute and to change those selected (by picking) attributes to colour 252.
At the moment, I'm using a custom macro : ^C^C-ATTEDIT C;252;;
But if I've got a lot of attributes to change, it takes awhile to complete.
I know about BATTMAN but I do not want to change the block entities in that way. The reason I want to change the attributes to colour 252 is because here at this company we do existing drawing in colour 252 and any new equipment on its proper layer colours.
I've had a simple lisp I've been using for years that suddenly disappeared. It required that you identify a block name, tag name, and the value that you want the tag to be. All of this is performed via command line, so it is scriptable. Since I lost it, I've been experimenting with -attedit. This command comes frustratingly close to what I'm looking for, except it only appends an existing tag, or replaces a specific string within the tag; I can't get it to replace the entire tag, regardless of its value.
1> Any lisp routine that does what I describe? or 2> How to make -attedit replace a tag value without regard to what the value currently is (like a * wildcard)?
Is this something that is possible? Basically I have an excel file with sample data that comes coded (red background for fail, Green for pass) Then we transfer that into halos on a DWG. got a routine to count the halos in a DWG. Now I was thinking it would be nice if it compared the number to the excel file to make sure no mistakes were made when placing the halos.
So as I mentioned I've seen rountines to read data in cells but none to count cells based on colour.
I have a routine that counts dynamic blocks by visibility state and stores that information then prompts for scale and color and stores that information. Then a legend begins to build from the data and a collection of blocks to reflect the dynamic blocks and their visibility state. Everything works great on all of the machines around the office except on one. When the legend begins building, the one user is getting the DDATTE dialog instead of allowing the values to populate as expected. So, I had him change ATTREQ to 0 an run again. No deal, the same thing happens again and again. And; it only occurs on the one machine.
I would like to select all instances of a block, and put a new block on top of them using the same properties (insertion, rotation) but am unsure how to do this
MyProblem: after I insert the block “NrPunct” in my drawing ,, I cannot modify "textHeight", when I edit the ATTDEF (or attribute) with the command “DDEDIT” . Why?
We have a block contain 10 attibs to be seen with 8 differents scales making 80 attribs! (We use that before Annotative features). When we edit this block, we have a LISP that ask for the 10 avlues, and copy it for all the scale.
This lisp use the block ename in argument.
We start to use that block with MLEADER, but we can not edited with our lisp (can not find the ename of the block in the MLEADER definition ).
Is that a way to find this ename, and to be able to modify (our substitute) all the attributes value.
I am trying to update my Title Block with a LISP routine (As the title implies).
So far, this is what i have...
(defun c:aTest (/ ss att) (if (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 "TB_PARAMOUNT_ELC") (cons 66 1)(if (getvar "CTAB")(cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE"))))))) (progn (foreach ent (mapcar 'cadr (ssnamex ss)) (setq att (entnext ent))
[Code]...
The title block, block name is static. The attribute name is static.
My ultimate goal is to copy the value of one attribute and "paste" that into the value of another attribute, and itterate this through the entire project.