I have blocks forming a column, and I need to allow the user to select the top block of the column but return the bottom left corner of bounding box of the bottom block in the column.
(DEFUN NXT-INSPNT (/ BLKLST CURENT CUROBJ IDX IPNT MCMD NENT SEL SS VENT) (PROMPT " >> Pick the Category HEADER to add note:") (SETQss nilss (SSGET ":E:S" (LIST (CONS 0 "INSERT"))) ) (IF ss (PROGN (SETQ sel (ENTGET (SSNAME ss 0)) iPnt (CDR (ASSOC 10 sel)) ) (princ iPNT) (setvar "attreq" 0) (VL-CMDF "-INSERT" "LEG-NOTE" "S" 1 iPnt 0 PAUSE)
[Code] ....
I'm not exactly sure where my code is failing but I get the following error.
I use the bounding box (vla-getboundingbox) to assess parameters of blocks. These blocks have text on some of the faces that extends beyond the simple dimensions of the blocks themselves. I'm wanting to have bounding box ignore the text and can't sort it out. I've tried putting the text on a separate layer and turning it off and freezing it.
I've considered looking at sub entities and filtering out the text but I don't know if there is a solution here or not.
The first rectangle is drawn from 0,0 at the World Coordinate System. There is never any trouble with the code below when the objects are drawn at the WCS. The problem is when I try to draw a bounding box around an object while in another UCS. It seems that it always draws the bounding box at the WCS instead of my UCS. I have used (trans <pointlist> 0 1) on all combinations it seems and I still cannot get it to draw the bounding box at the current UCS.
I am trying to customize AutoCAd for a special domain where attribute values need to have a type. I can have a clean integrated solution by manipulating the acad.dcl or base.dcl .I am using AutoCAD 2012 . I want to extend the " define attribute" and "edit attribute" dialog boxes to promt the user for a value type when they define an attribute .I can't find the definition for these dialog boxes in acad/ base dcl files. Ideally I want to add another tile definition to these dialog boxes .If that is not possible atleast spawn a different dialog box from the "define attribute " dialog box that will collect the value type from the user.
I have 3d items exported from sketchup, that have extrusion vectors to them.the VLA-GETBOUNDINGBOX lisp function seems to return values from the block's coordinate system.
I need values as if there was no extrusion vector, in WCS.I am not clear on how to do this, as it seems like I want a fundamentally different box.Is there a way to recalc the box orthogonal to world coord system for each insert of the block? URL....
The error below has appeared randomly when AutoCAD 2011 is started. There was not an error of this sort, but it suddenly appeared and some of the LISP routines will no longer work.
*Invalid attempt to access
a compiled function definition. You may want to define it using defun-q:
There is no other mention of STRNUM in the whole of the lisp.
There is an accompanying setvars.dat, wherein apparently, the writer compiled a data file of all the system variables in AutoCAD2008, each variable being followed by an '=' and then a description of the variable.
If necessary I can post the whole lisp and dat file, but was hoping to discover the intention from the above extract and therfore where I might work out an alternative to this line.
Looking to turn a string to a real? If so, why are there two 'arguments' following the 'function' STRNUM?
I'm trying to build a command to replace AutoCAD's "DI" command, to give distance and delta x, y, and z values in decimal and imperial, and keep the angles in XY plane and out of XY plane.
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
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.
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.