AutoCAD Visual LISP / AutoLISP :: Change Dynamic Block Property (Scale Uniformly) Automatically

Dec 16, 2010

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.

View 4 Replies


ADVERTISEMENT

AutoCAD Visual LISP / AutoLISP :: Modify Property - Insert Polyline As Block

Sep 22, 2011

I am starting with a polyline then i use the pasteblock command to insert that polyline as a block.Now i can pull up the property box and change the xyz scale.

I would like to know how to change these setting in my lisp.The scale will be x=1 y=0.1 z=1

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At List Block And Dynamic Block

Apr 18, 2013

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
 
(vl-load-com) (defun c:pmb11 ( / sele cod bloque nbloque lista pt ) (prompt "
block: ") (setq sele (ssget ( List'(0 . "INSERT"))) Cod 0 )cod (1+ cod) (repeat (sslength sele) (setq bloque (ssname sele cod)) (setq pt (cdr (assoc 10 ( entget bloque)))) (command "punto" pt) );repeat ) 

View 4 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 :: Routine That Automatically Inserts Parameter In Block

Apr 26, 2012

I am working on a lisp routine that automatically inserts a parameter in a block and then ads a stretch command to it. But the problem is that for the stretch command u need to select the drawn parameter. So my plan was to get the name of this parameter (car (entsel)) and feet it to my lisp program. But when i do that it doesn't work because autocad demands a parameter. 

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Making Dynamic Block Grip

Nov 4, 2013

Basically I want a dynamic block that works like an MLeader. I have built the block and can manipulate parameters, but haven't found a way to select a specific dynamic block grip.

It has a base point but then after placing the block I want to activate the stretch grip.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Editing Dynamic Block Elements

Apr 22, 2012

Is it possible to create a dynamic block completely from scratch using Lisp?

I also want the ability to be able to create different dynamic block geometry depeding on the Visibility parameter.

I seem to be able to create the normal (non-dynamic) block geometry using Lisp but cannot seem to find out a way to enter the block editor and create stuff pertaining to dynamic blocks.

I have 1000's of dynamic blocs to create and looking to a way to automate this using Lisp.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Accessible Parking Dynamic Block

Jun 2, 2012

I have successfully created accessible parking dynamic blocks. They work fine for new parking because they are set to always be a certain width. 5'-0" or 8'-0" for an access aisle, etc. What i would like to figure out is how to create an existing access aisle that can be stretched horizontally & vertically.

The problem is that when the striping is at an angle as is the case with the access aisle how do i go about doing this? Could i put some sort of geometric constraint to be able to stretch it horizontally & vertically & keep the striping at a given angle. Also the striping may need to array as it is stretched. 

View 7 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Setting Dynamic Block Visibility?

Aug 17, 2011

Attached is a lisp that reads an attribute block value and uses that value to set a named view. The attribute block is a diesel expression field which reads the drawing number, so it changes as the drawing is saved to a new number. I use it when I am preparing road alignment drawings. I prepare the first drawing in the set, saving views for all drawings and when I'm done I copy that drawing 001 as many time as I need, rename them drawing 002, drawing 003 etc. and use the attached lisp with scriptpro to set all my saved views.

I also have a dynamic block called "key" in the drawing with visibility states matching the named views.

either expand this lisp or create a new lisp to set the visibility using the "VN" variable.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Dynamic Block By Its Name But It Does Not Work?

Sep 23, 2011

i am trying to select a dynamic block by its name but it does not work

(setq WW (ssget "x" (list (cons 2 "WET WELL"))))

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Using Parametric Drawing Or Dynamic Block?

Dec 19, 2012

We currently have a bunch of Lisp programs to create drawings but I am interested in exploring how I can maybe use Lisp with either dynamic blocks or parametric drawings. I just don't know which would make more sense. Currently we have programs where we enter things like width, height, leg or radius, bars wide and high etc and it creates a drawing like the one I've attached. I know that if I can create this drawing as a dynamic block or a parametric drawing, then when there are revisions, I don't need to create the drawing again. I can just adjust the parameter or the dynamic block. What makes the most sense, a dynamic block or a parametric drawing? I should note that I'd still like to use autolisp to create the initial drawing (or insert the block) since that's what the users are used to.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block Programmatically?

Feb 23, 2008

I figured out how to entmake a Block with attributes based on user input for insert point, rotation, etc.

My block is a detail bubble that is a circle with a tail, that cuts the object and shows direction of cut. I will include that with this post.

My problem lies in this. I've used dynamic block features such as linear for the tail length, and the cut length, and angle for the direction of the tail.

My old routine was simple, it would ask for detail point and angle. From that it would insert a block that was just the bubble and draw the tail and cut with a polyline.

Since then I've been able to use entmake, which is a lot more powerful for creating entities in AutoCAD. But for the life of me I can't figure out how to add the dynamic properties of my "new" detail block that has the tail, cut and bubble in one.

what I need in the entmake statement to make this create programmatically instead of inserting the block, then modifying it, if possible.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Make Block Uniform Scale?

Oct 8, 2009

Is there any way to make a block uniform scale using lisp? and also make a block drawing uniform scale?

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Scale Changes Upon Inserting Block In The Drawing

Jul 17, 2013

I had been trying to insert a title block (block) in to a drawing as part of changing the title block But in some drawings the block gets scaled off. Is there any system variable or any solution to maintain the drawing without getting scaled while inserting block.

I had used -dwg units and this appears to single drawings only. Any other way to do this to all the files in a folder.

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dynamic Block - Accessing Action Parameters

Jun 3, 2013

I have a new project coming up where I need to write some simple programs to access the dynamic action parameters in some existing dynamic blocks.I have viewed what I could find on AU, but I still ave not found anything relating in-depth to dynamic blocks. 

Any good Tutorials, Articles, or White Papers, on  working with dynamic blocks with autolisp/ vlisp?  The main function is to access a parameter and change it by entering a numeric value, updating the block. say from a linear/polar stretch, or a linear/ polar move.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Possible To Create List Box For Dynamic Block Previews

Sep 23, 2013

I've spent the last week and a half creating blocks that have between 2 and 10 visibility states in order to represent the separate iterations of common valves.

I would like to construct a lsp and dcl (we work off of a network drive that would enable a stable location for an accompanying dcl file along with the base lsp, though I believe that in order to do what I'm wanting done some on-the-fly dcl manipulation may be necessary) that would display the current drawings in our dynamic block folder and upon selection within the first List_box, would display the different options for visibility states for the block in the 2nd list_box. After a user selects one of the visibility iterations that are now displayed in the 2nd list, an image preview (or slide, I can handle creating the different slides for each block once if required) of how the block will be displayed in the selected visibility state would be shown in what would be the 3rd space, this time an image preview and not a list_box, though I would like proportionality between the list_boxs and the image preview. Some white space is allowable in the list_boxes.

I'm not even sure if this would be possible, but I'm assuming you can access the different visibility states in the same manner that you could access polyline verticies or block definition attributes.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block At Default State

Feb 15, 2013

When scanning the BTR (Block Table Records) and encounter a "*U" block definition

how can i know if it relate to dynamic block and have it's name?

acutally my current goal is:

when insert a dynamic block at default state (no change in it's dynamic properties/actions)

it's 'Name and 'EffectiveName is equal, when set some of it's properties it turns to dynamic anonymous

with Name = "*Unn"

Can i programaticlly set the block reference to be dynamic anonymous (with out setting any of it's properties)

cause i would like to modify it's BTR (with out effecting the original BTR dynamic block) but do not want to convert it to static anonymous block.

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: SSGet Specific Dynamic Block / Since They Are Anonymous

Sep 19, 2011

If you do a LIST command on a dynamic block... AutoCAD tells you the Block Name as well as the Anonymous Block name.

How can I use ssget to snag all Dynamic Blocks that use the 'Real Block'?

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Retrieving Number Of Entities In Dynamic Block

May 19, 2013

I am modifying stuff in a dynamic block insert entity. There is no "endblk" entity at the end of these definitions and I need to cycle through every entity within the block definition. When it gets to the last entity,  I get an error because you cannot entnext passed the last entity. There are 2 things:

1. How to retrieve the # of entities in a block without cycling through it.
Or
2. A quick lesson in the *error* function, I cannot figure out how to implement this. I basically want to to say:

(if (entnext myent)) returns a error, don't abort & continue on.

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Diesel Expression For Attribute And Dynamic Block

Mar 15, 2013

I have a task where I need to automatically insert the drawing number (no path), plus two additional items, one an attribute, the other is within a dynamic block. I can achieve this using fields but now I havce to truncate some of the text.

It seems like I can't edit if I am using fields and attributes/blocks can't be used in Diesel (correct me if I'm wrong)

This is the information I have:

Filename: 123456-AS-WE.dwg
Attribute: Q2
Dynamic Block: X1 - Additional Information

This is what I require: 123456-AS-WE [Q2] [X1]

This is what I have so far: 123456-AS-WE [Q2] [X1 - Additional Information]

In other words, I need to restrict the dynamic block field to the first two characters.

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Rotate Block Current Annotative Scale ONLY

Dec 6, 2011

I have the below code (from a user here on the forum) which works great for aligning text, mtext and blocks to 2 points.  For annotative entities, it respects the rotation angle for mtext and text. 

ie I have an mtext object at 1"=20' scale and at 1"=40' scale.  I run the command when the current annotative scale is 1"=40'.  The object at 40' scale has changed, but the 20' scale is unchanged.  This is working as I would like it to.

But for annotative blocks, it gets weirded out.  In the above example, the block at 40' will rotate, but so will the attributes at 20' scale.  But linework and hatching at 20' scale will be unchanged.  it looks really weird. how to get it to play nice with blocks.  Ideally, I'd like the block to be at different rotation angles in different annotative scales.

(defun C:R2P (/ ss ang edata); = Rotate objects to align with 2 Points (setq ss (ssget '((0 . "*TEXT,INSERT"))) ang (angle (getpoint "
First alignment point: ") (getpoint "
Second alignment point: ")) ) (repeat (sslength ss) (setq edata (entget (ssname ss 0))) (entmod (subst (cons 50 ang) (assoc 50 edata) edata)) (ssdel (ssname ss 0) ss) ))

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Annotation Scale To 1:2

Apr 26, 2013

take a look at the test.dwg it contains a block named 'box' (which is a rectangle) and some attributes. the annotation scale is 1:1 and i zoomed in to focus on one attribute.

change the annotation scale to 1:2 and you will see the attribute grows by 2 - that's ok! now load attmod.lsp and run attmod command and you will see the attribute grows again by 2

even the command only (entmod) the attributes without making any change.(to restore it use battman sync)Is there a workaround to this bug?

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block With Visibility State Pre-selected?

Dec 24, 2013

I currently insert certain dynamic block into drawings with a short function that first inserts the specified dynamic block and then immediately changes the visibility state to one specified as an argument to the function.

I'm wondering if it is possible / better / faster to somehow insert the dynamic block with the decided visibility state simultaneously. I've been amazed by many capabilities of VL so I wouldn't at be surprised if this can be done. (the dynamic blocks I'm inserting could have many multiples in the drawing but I need this method to only affect the one being inserted at the time the function is called. I currently use entlast to decide which one is being inserted.)

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Dynamic Block And Modify Stretch Points

Nov 30, 2010

I have a dynamic block that I would like to insert via a lisp routine. When the routine is run from my menu I would like to select two points on the drawing area. Then I would like my dynamic block to be inserted at one of the points I selected and then I would like a specific "point" of my block to be stretched to the other point that I selected. I was wondering if this is possible with LISP? I have my old LISP program I wrote that draws a leader and then inserts my block but that was before I started working with dynamic blocks.

Here is my current

(defun c:wldsym()
(setq osnapold (getvar "osmode"))
(setq orthold (getvar "orthomode"))
(setq dimsc (getvar "dimscale"))
[code]...........  
  
wld1r.dwg is my current block. It has some dynamic properties already. But I'm trying to add new properties that can be seen in my working test drawing wld1r-new.dwg

When using my code with "wld1r.dwg" you can see how everything behaves right now. Then open "wld1r-new.dwg" and note that the insertion point and a stretch point my default are in the same spot. Work with the two stretch points and look at how the block reacts.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Count Dynamic Block Including Total Length?

Apr 2, 2012

lisp to count dynamic block including total length.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Invisible Attribute Constant Dynamic Block Visibility State?

Jan 24, 2013

I have a dynamic block with several visibility states, and each visibility state has one invisible-constant attribute. I can't seem to wrap my head around dynamic blocks well enough to get the value from the active visibility state invisible constant attribute. I know how to get the visibility state like this:

(setq ss (ssget "_x" (list '(0 . "INSERT") '(2 . "`*U*,<DynBlockName>") (cons 410 (getvar 'ctab)))))

 but what next?

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Select Dynamic Block Based On Previous Selected Point

Apr 9, 2012

For a program i am working for i have to extract the base point of a dynamic block.

This can be done perfectly by this function:

(cdr (assoc 10 (entget (car (entsel)))))

But i want the entity selected based on a previous slected point. So for example when i selected pt1 (which is a point at the border of the dynamic block) i want to be able to extract the base point on the block whit this point.

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Dynamic Blocks Change Visibility State

Nov 1, 2013

I have 4 Dynamic Blocks with the same name, but each are on different layout pages. I need to change the visibility state of all 4 to the same value. So far every attempt of mine has failed.

My process at this point is to: build a selectionset of all 4 Dynamic Blocks with the same effective name, convert the selectionset to a list of entity names, then use a foreach to change the visibility states one at a time. Currently, I get "error: bad argument type: lselsetp <Entity name: 7ffff7b6c90>". <Entity name: 7ffff7b6c90> is the entity name of the first block in the list. I'm guessing it's because the block is found on a non-current tab
 
(defun chgdynprop (e propname newval / obj v vval sal tot i) (setqobj (if(= (type e) 'vla-object) e (vlax-ename->vla-object e))) (if (= (vlax-get-property obj

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Block Colour Change

May 1, 2006

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.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layer

Jul 25, 2006

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..

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Change Block Layer After Insertion

Mar 7, 2013

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.

View 9 Replies View Related







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