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
ADVERTISEMENT
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
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
Jun 24, 2013
I can't find my notes on how I fixed it. When we insert our title block, it automatically inserts the drawing number. For one user, it doesn't work. The title block inserts, but it won't put in the drawing number. I seem to remember I need to change a setting or something to get it to work, but I can't remember what it is.
View 3 Replies
View Related
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
Mar 20, 2013
I have a specific problem with renaming layouts. I found some similar lisps, but I just could not make them work.
In every layout I have following attributes.
PROJECT: 306
PHASE: RD
OBJECT: A0101
PART: EL
DRAWING: 611
ZOOM: X
REVISION: 01
I need to rename every each of layout using those attributes. Layout's name should look like that: "306_rd_A0101_el_611_x_01" . "rd", "el" and "x" must be written using lowercase.
View 9 Replies
View Related
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
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
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
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
Aug 18, 2011
We are using a title block and it has an attribute field that links to the file name. Now one of our projects is adding the revision to the CAD file name, but it messes up our drawing sheets.
i.e. It was fine when the CAD file name was 111-A222-ZZ-X-123456.dwg and this would display the complete 111-A222-ZZ-X-123456 in the drawing title.
Now we need to do this, the CAD file name, 111-A222-ZZ-X-123456-001002-A1.dwg and we still need to just show 111-A222-ZZ-X-123456 in the title block, striping away the 001002-A1.
View 8 Replies
View Related
Jul 18, 2011
I'm using Autocrat 2004.
I have a attributed titleblock. Sometime in the future I will need to change the date attribute to another value, i.e.. 7-11 to 9-11.
I can't place a text string in the title block because this title block is used for multiple drawings and the date will be different for different sets. I can't have numerous title blocks because of the client's requirements.
Question:
Is there a way to write a script to open a drawing, look for the specific attribute, change the date value, save and close the drawing - across multiple sheets? Would a lisp routine called by the script be able to do this? Or a script file called by the original script file? CAn you even use a script file in this manner?
View 7 Replies
View Related
Oct 22, 2009
I am working on a large project where a 3rd Party firm has turned over 100s of drawings that we need to get into our system. The problem is that they did not name their physical files properly. We have a particular numbering system for our drawings, the engineering firm did fill in our attributed title block properly and used our numbering system correctly within the drawing. However, their physical file name follows their format. We need to have the physical file name match the information in the title block to get into our system.
Is there a way to "Batch Rename" these files by reaching into the title block and then renaming the physical file to match the attribute?
I have to be honest, I may use AutoCAD 50 to 60 hours per week, but I am no programmer! I am just the go-to person here for AutoCAD whom is stuck trying to come up with a efficient solution for the project team whose engineering firm could not follow our procedures! I was hoping some sort of batch routine could take care of this problem for us instead of us having to individually rename each physical file one by one.
View 9 Replies
View Related
May 9, 2013
How to export title block attribute text .. in a order from different layout .? file ext .xls or .txt i got a tool named Autocad Automation tool but it not work very well autocad have data extraction - its also came all text .. and not in order .. can we develop the any lisp for that ?.
View 4 Replies
View Related
Apr 30, 2013
I need a routine that will duplicate the current sheet's Layout tab and content to the next tab, set it current, delete the titleblock (by name) on the new tab and reference in a differently named titleblock, 1:1, 0,0 onto the new Layout tab. I'll be running this in a batch script.
View 9 Replies
View Related
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
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
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
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
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
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
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
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
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
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
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
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
Jul 19, 2012
Is it possible to write an event handler for an autocad event/ command like insert new block? I want the event to trigger the execution of an update routine . something like this post
[URL]
how do I access the autocad object in autolisp?
View 4 Replies
View Related
Mar 29, 2013
It's been too long since I created one of these for Toolbars. I need a macro that will insert and explode a block. I just need the block's content, not the block itself. I can create a maco to explode a block with no path, but can't remember how to include the "*" in a file with a folder path to explode the block while its being inserted. Because of spaces in the file name, quotes (") must be around the path.
View 1 Replies
View Related
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
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