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


ADVERTISEMENT

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 :: 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 :: 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 :: Dynamic Blocks Not Changing Visibility State With Automated Process

Oct 6, 2011

I have created a bunch of templates (title block type drawings) for my company. In these templates there is a dynamic block used for a particular note. Based on customer number, this note will be changed.

We have a program that will insert the correct template based on the drawing type. It will know the customer number and change the dynamic block visibility state to reflect the correct text in the note.

Here's the problem; I don't know why, but sometimes the visibility state does not change. It's not the code as it works just fine in some drawings.

I've gone in and just changed the visibility state name, then changed it back, then saved the drawing and it worked.  In some cases, I've also just gone into the template and deleted the dynamic block and re-inserted it, and it began to work again.

Having trouble with dynamic block visibility states not working when using an automated process?

View 2 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 :: 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 :: 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 :: Insert North Block Oriented On Two Selected Points

Sep 19, 2012

I am trying to insert a norht block oriented on two selected points with the following

(defun c:North ( / ss )
 ;Orientate North Symbol
 (setq oldos (getvar "osmode"))
 (setq blk (vlax-ename->vla-object (car (entsel "

[Code] .......

I am not sure how to (a) erase the selected north block, then (b) make the  insert north block in its place bit work.

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 :: 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 :: Get Visibility State Name From Uname?

Jan 2, 2014

(Part of a table that shows the block in the first column the block name in the second and the count in the third)

(IF (SETQ ss (SSGET "x" '((0 . "INSERT") (2 . "PoolLight,`*U*") (410 . "Model")))) ;| <- Just an example the full blocklist is much longer and not all are dynamic |; (WHILE (SETQ Ent (SSNAME ss 0)) (SETQ BlkName (CDR (ASSOC 2 (ENTGET Ent)))) (IF(SETQ tempList (ASSOC BlkName EndList)) (SETQ EndList (SUBST (CONS BlkName (1+ (CDR tempList))) tempList EndList)) (SETQ EndList (CONS (CONS BlkName 1) EndList)) ) (SSDEL Ent ss) ))

getting the visibility state name for each instance of a dynamic block. The blocks display properly with the count, but the block name displays the Uname - *U59, *U61, *U66, *U68, etc...

(Also, why LISP created tables always seem to force a Title or Header no matter how I try to supress it?)

(VLA-PUT-TITLESUPPRESSED TblObj :VLAX-TRUE)(VLA-PUT-HEADERSUPPRESSED TblObj :VLAX-TRUE)

Both seem to have no effect. If I don't include one extra row to the table then it fails to populate all together. 

View 3 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 :: Insert A Block / Explode And Rename Nested Block With Suffix

Nov 30, 2012

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

[Code] .......

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Searching For Dynamic Blocks With Visibility Perimeter That Is Case Sensitive

Dec 19, 2013

create a routine to list all the dyanmic blocks in my drawing with a specific visibilty parameter name. The problem with the blocks that I'm trying to search for in my draiwng is that the visibility names are very similar with the only differences being CASE sensitivity (ie. OBJECT vs. Object).
 
(defun c:test (/ BNAME DATA E I PNAME SS VIS) (if (setq data nil vis (getstring T "
Enter the Visibility Parameter Name: ") ss (ssget"_X"(list (cons 0 "INSERT") (cons 2 "`*U*")) ) ) ;; setq (progn (repeat (setq i (sslength ss))(cond ((and (setq bname(vla-get-EffectiveName (setqe (vlax-ename->vla-object (ssname ss (setq i (1- i)) ) ) )) ) (setq Pname(car (vl-remove-if-not '(lambda(j) (eq (strcase (vla-get-PropertyName j)) (strcase vis) )) (vlax-invoke e 'GetDynamicBlockProperties) )) ) (not (member bname data)) ) (setq data (cons bname data)) (foreach itm data (print itm)) ));; cond );; repeat );; progn );; if (if (null data) (princ "
Block/Parameter Name not found")) (princ))

View 9 Replies View Related

AutoCad :: Dynamic Block Changes Visibility State

Nov 20, 2012

I am using AutoCAD 2012 LT but also have a AutoCAD 2013 (network) license available to use.

I am having a problem with my dynamic blocks. I created a set for access control and used them in several other details such as door layout and panel wiring ect. but if I try to combine a drawing with multiple tabs to show a Door detail and the panel wirirng the Dynamic block goes back to the default or original visibility state.

I have attached Sample1 and sample2 if you try to copy from one of the drawigns to the other you will notice that the dynamic blocks will change.

I also attached the original Dynamic block.

Sample1.dwg
Sample2.dwg
Original.dwg

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Place Circle On Selected Blocks Insert Point?

Mar 11, 2013

You have a dwg with multiple sets of different blocks and a circle you want to place on the insert point of each set blocks. 

You select the circle then select one of the blocks in the set and the circle is placed on the insert point of each of the blocks in that set. It would save time from doing it manually and save on mistakes.

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Odd Insert Block

Sep 26, 2013

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.

View 5 Replies View Related

AutoCad :: Visibility State For 3D Wireframe Dynamic Block

Dec 2, 2011

I'm trying to create a dynamic block with visibility states for different wireframe sections, with objects (simple lines) in x,y & z planes.

The block represents a bay of scaffolding, which dynamically arrays in length in set bay sizes, but i want to add visibility for different height section arrangements (i.e number of scaffold lifts in 2m lift heights)

I have this working with the maximum section (16m high), and I hoped to be able set visibility states from for the sections 16m down to 6m by "make invisble" the upper scaffold lifts in reducing heights.

The block editor will only give me the plan (x,y) view to modify the dynamic elements. Is there a way to view left, right or even isometric in the block editor?

View 1 Replies View Related

AutoCad :: Dynamic Block Not Working When Using Visibility State

Apr 11, 2013

I prefer using Visibility State to flip objects instead of actually using the Flip command! Simply because there are less grip points for the user when using this block. My problem is: when adjusting the physical properties of the block by using the dynamic features and then changing the visibility state (e.g. left to right), the block is no longer intact so all of the grip points will no longer alter the block accordingly.

details-section_marker(both).dwg

View 2 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert One Or Another Block Into Drawing

Apr 22, 2013

I am trying to insert one or another block into a drawing, and i need to do this 8 times per drawing. 

(defun C:detector (/ filename gas pressure)
(repeat 8 (initget 1 "Gas Pressure")
(setq filename (getkword "
Enter Detector Type [Gas/Pressure]: "))
(if (= filename "gas") (command "-insert" "*T:\acad\schematic_circuits\suny\sunygasdetectornew.dwg" pause "" "")
(or (if (= filename "pressure")
(command "-insert" "*T:\acad\schematic_circuits\suny\sunypressuretransmitternew.dwg" pause "" ""))
) ;;end or
) ;;end if
) ;;end repeat
)

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block Into Several Drawings

Aug 2, 2013

Any way to insert a block onto many different drawings quickly? I have a title block I need to insert into about 100 drawings. It seems very tedious to open each drawing and insert 100 times.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block At Intersection

Oct 15, 2013

I tried to adapt the code provided by scottbolton in the "Insert block at intersection" thread to suit my needs. I would like to be able to enter a block name, and let that block be inserted at intersection points.

But i keep getting a DXF error.

(defun c:sbx (/)
(vl-load-com)
;;;define block used in program
(setq bloktype (getvar "USERS5"))
(prompt "asiswaarde: ")
[code]...... 

View 9 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Point At Every Block?

Apr 19, 2013

I need a routine that inserts a point at the insert point or block named "Insert_Point" at every block in the file. The routine could use the current layer, which would be set prior to starting the routine. If it could request the user for the PDMode value and PDSize that would be great too. This will assist me in creating block libraries.

View 9 Replies View Related

AutoCAD Dynamic Blocks :: Exploding Block With Visibility State

Aug 8, 2012

Here at the company I work for, we have different drawing templates for certain clients.  The templates share quite a bit of information with only a few differences.  I combined them into one dynamic block with different visibility states for each template.  But when we get ready to use a particular template, the block will need to be exploded to use all the information available. 

My question is what happens to the objects not on the current visibility state when exploded?  It seems to just disappear.  Does the exploding essentially delete all objects not visible? 

View 1 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Sorting A List Of Selected Block

Jun 12, 2013

I found a lisp for counting of selected block in a table drawing, but I can not remove the bottom line of this lisp that displays "total" blocks. How to remove this line from "total" that is created in the last row of the table that lisp.

lisp : ========================================

(defun c:TABL (/ blk_id blk_len blk_name blks ent h header_lsp height i j TOTAL
len0 lst_blk msp pt row ss str tblobj width width1 width2 x y
)

[Code]....

View 4 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Boundary To Title Block?

Jan 3, 2012

1. I want to all selected profiles or blocks set to one object, than continue to select second object,(see attached drawing file). How to write the "ssget" lisp.

2. Command "line" ask me specify next point.

3. Found object boundary prompt me to "select oblect", when i selected profile, with the error: bad argument type: consp.

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting Block With Insert Command?

Mar 27, 2012

I am working on a lisp file that lets you select a block and automaticaly change the layer and color in block editor. Afther this it exits block editor, deletes the original block and places the new one.

It works fine accept for the last part.

When i incert my new name whit the insert command it automaticaly changes the name whit autofil so it wil still pot my originial block (the new block name is only two characters shorter than the old one).

View 5 Replies View Related

AutoCAD Visual LISP / AutoLISP :: 2014 - Insert Block With Attributes

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

AutoCAD Visual LISP / AutoLISP :: How To Insert Block On Layer That Is Frozen

Feb 19, 2013

We are using autocad 2010 and I have written a routine that will insert several blocks on to several layers.  I thought it worked flawlessly, until I used it.  Our drawings use layer states.  When one state is in use, all the other layers are frozen.  We want to insert a block, at a specific point chosen by the user, and the lisp routine will insert a couple of other blocks at that same point, but on a layer that is frozen.  Three blocks installed in all, at the same point, on two layers. The routine works if all layers are thawed, but not if the layers are frozen.

(defun c:lP1 () ; this starts the routine
(setq temperr *error*) ; saves *error*
(setq *error* rerr) ; sets the new error variable
(command "_.Undo" "_mark") ; start of "undo" command
[code]....

View 8 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Create / Insert Block In Drawing

Sep 26, 2013

take a look at this piece of my LISP-routine.

(command "_.block" pause pause ss "")

where:

ss  -  is a Selection set of some entities

In the rest of code, I don't change the values of initdia, or cmdecho, or whatever else  

I haven't sill understood them that well.The problem is the following:

When My routine executes this line, I am promted for:

1. block name - that's OK

2. insertion point - that's OK

3. then the block-command receives correctly the entities from ss-selection set - that's OK

4. then all the object dissapear! **Problem here**

The block is created... I can insert it in the drawing from the block-data base...

But is there a way to let this block stay in the drawing ? without disappearing?

View 2 Replies View Related







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