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


ADVERTISEMENT

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

Sep 26, 2012

trying to insert point instead of block.

(setq blok (entget (car (entsel))))

(setq point (cdr (assoc 10 blok)))

(setq XX (rtos (car point) 2 20)) ;; x koordinata bloka

(setq YY (rtos (cadr point) 2 20)) ;; y koordinata bloka

(setq ZZ (rtos (caddr point) 2 20)) ;; z koordinata bloka

(command "point" xx,yy,zz) is not working

!xx="5582453.414999999" but when i (atoi xx) i get 5582453 no dedimals...

how to create valid insertation point from xx, yy and zz?

View 6 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 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 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 :: 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 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 :: Insert Block With Pick Point On Line Prompt?

May 8, 2013

I have a lisp routine that I would like to add to. Right now when running the macro the user is not prompted to "Pick Point On Line" in this example

(command "insert" blk "s" var1 pause pause))

I have added the line

(setq pt1 (entsel "Pick Point On Line "))
(command "insert" blk pt1 "s" var1 pause pause))

but the command doesn't seem to like my PT1 value

BLK and VAR1 are set in another lisp routine.

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 :: 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 :: 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 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 :: List Block Attribute Value

Feb 3, 2012

I'm looking for a lisp routine that will globally list all the values from a specific attribute tag within a specific block. The attribute tag is "COMMENT" and the block name is "FSD".

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

AutoCAD Visual LISP / AutoLISP :: How To Insert Block To Points Taken From Txt File

Jun 28, 2013

I got this code in a web trawl to insert a block to points taken from a txt file......

its coming back with an error as follows:

; === Top statistic:
; Function definition (with number of arguments): ((C:INSERTBLOCKS . 0))
; Check done.

What does this mean and how can I fix it.

(defun c:insertBlocks (/ txtFile xyData expertVar attreqVar)(setq expertVar (getvar "expert"))
(setq attreqVar (getvar "attreq"))
(setvar "expert" 2)(setvar "attreq" 0)
(setq txtFile (open "c:\cad\textfile.txt" "r")) ;

[Code] ......

View 3 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 Block In A Specific Layout Using Function

Jan 28, 2012

I would like to insert a block in a specific layout (eg. "LAYOUT13") using the function vla-insertblock

I have already searched the web and this newsgroup but have not found the solution.

View 3 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Insert Block And Fill In Attributes With Var Values

Nov 4, 2011

I am using 2008 and I have a dynamic block with attributes that I want to insert with the below program and have the attritute values filled in automatically.  I have done this with other programs in the past and they worked great with literally no problems.  They were not dynamic blocks may be the reason this does not work. Why the block will not fill in the attributes like it should.  Occasionally in my testing I see a message about "units" when I am inserting the block but I have my insunits set to 0.  I have attached one of the blocks I want to use.  I am thinking either you cannot do this because it is a dynamic block or there is a new variable that won't let it work. 

(setq upisosym "L:/AcadUtilsJack/Programs/InsertIsoSymbols/ELL90BW_Flip_01" isosym "rat")
(setq upod "3" upsch "sched" upmatl "matl" uprat "400")

I found these two new variables and turn them off or 0 thinking they might be the problem???

(setvar "INSUNITSDEFTARGET" 1)
(setvar "INSUNITSDEFSOURCE" 1)
(defun c:JD ()
  (setvar "attdia" 0)
  (setvar "attreq" 1)

[Code] .....

View 9 Replies View Related

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 :: Attributed Multi Block Insert From Custom DCL

Dec 27, 2011

I have been working on an AutoLISP routine which is intended to:

1) collect input from the user via a DCl dialog box

a) Create a List of the non-null "GROUP_CODE..." variable values collected from the dialog's settings

b) Create a List of the "ESN***#_Part" variable values collected from the dialog's settings (does the List elements' order need to be reversed after collecting them?)

2) Prompt the user to select an insertion point

3) Insert a Block named "ESN-CONTROL-WIRED" which has multiple attributes

a) Apply the first List element collected at step 1.a above to the attribute tag "INPUT_ADD" in the block

b) Apply the first List element collected at step 1.b above to the Attribute Tag "PART_NUMBER" in the block

4) Insert a second instance of the Block named "ESN-CONTROL-WIRED" below the first instance

a) Apply the second List element collected at step 1.a above to the attribute tag "INPUT_ADD" in the block

b) Apply the second List element collected at step 1.b above to the Attribute Tag "PART_NUMBER" in the block etc. .... keep inserting the block "ESN-CONTROL-WIRED" below the previous on until all the input from the dialog has been displayed in the attributes. 

Notes:

The Dialog's pop-up lists are populated from external .TXT files which reside on our network (or alternate local C: drive folder if no network drive is found)

Inside the file "ESN_SENSORS_NUMBER.LSP", it is the function "ESN_APPLY_TAG" which I am struggling with how to write...

find inside the .ZIP file:

- (2) example screenshot .BMPs showing dialog box settings and what the resulting output in AutoCAD should look like

- (1) ESN_SENSORS_NUMBER.LSP

- (1) ESN_SENSORS_NUMBER.DCL

- (1) ESN_SENSORS_NUMBER.DWG with a sample output - and the definition of the block ESN-CONTROL-WIRED

- (1) ESN-OCC.txt  which populates the PopUp List Boxes

- (1) ESN-DAYLT.txt which populates the PopUp List Boxes

- (1) ESN-IR.txt which populates the PopUp List Boxes

View 6 Replies View Related

AutoCAD Visual LISP / AutoLISP :: Inserting Block On A Point Of Arc?

May 19, 2012

know a lisp routine that would insert a block @ a specific point on an arc? For instance if I have an arc that has a radius of 20'-0" & I want to insert a block at a set distance from the end of the arc.i could probably use the divide or measure command but I was hoping I could do it with lisp. I would also like to be able to move the object along the path of the arc at a specific distance.

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







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