AutoCad :: Mapping Values To Title Blocks Using Autolisp Routines?
Nov 19, 2012
I am trying to map values to my title block using an autolisp routine. I have entered (getenv "NEXTSHEET") & (getenv "PREVSHEET") into the descriptions fields and mapped these routines to 'NEXT_ATTRNAME' & 'PREV_ATTRNAME' attributes. When I run the title block updates no values appear on my drawing. Please note that I have included the program in my start-up suite. Please also note that when I enter 'NEXTSHEET' or 'PREVSHEET' on the command line, the routines are called and the correct values are shown on the command line. I just need these values to be visible on my drawing. I have attached the Autolisp routine that I am running.
I have an attribute blocks and this att block has two tag values , is there a simple code for to change 1st tag values automaticly according to 2nd values ?
for example :
1st tag (50x50) - 2nd tag ( 100 ) ==> 50x50-100
if i enter 201 valuse to 2nd tag then 1 st tag has to change as 100x100
if i enter 501 valuse to 2nd tag then 1 st tag has to change as 150x510
This time I'm wrestling with getting the values from multiple blocks. The blocks all have the same name but at least the attributes have names this time. Each block have exactly 4 attributes, like: att1 (a number representing chronological order), att2 (some data), att3 (the actual date as a string of when the data was added), att4 (some more data)
I need to get and store the attribute's values. I was hoping to make a selectionset of the blocks and step through using the chronological order number.
At this point I have tried several combinations of foreach and ssget "x" (list (cons 2 MYBLOCK)), but I keep getting errors that I'm sure are telling me that I'm not passing the correct information to the function for iterating through. I'm banging my head.
I have a routine I wrote years ago for R12 and it worked fine. Now when I try it in 2000 it freezes Acad when I select the first button. The routine is for structural steel members and the idea is to select a country of origin which brings up a list, then select a section type from the list which brings up another list of all available sizes. You then select the size member you want then insert it into the drawing. There is also an option to explode the block on insertion. If I remove the (set_lista) section from the following line it doesn't freeze.
(action_tile "AUS" "(setq sectype AA)(setq Country 1)(set_lista)")
(set_lista) is a selection of lists, the list to use is determined by the variable "sectype".
I can select the country I want then cancel the dialog box and type (set_lista) at the command line then reopen the dialog box and the list is refreshed. Just won't do it automatically.
I have writted a set of lisp routines with dcl files that I have implemented in most versions of Autocad since release 14. I can install the toolbars in Autocad 2013 but when I try to execute on of the commands, either by toolbar icon or command line, I get the message "Unknown Command".
I've gotten these two routines from different threads on here. One works with *text and blocks. The second works with multileaders.
I'd like to merge the two so one command can work with a selection set of any of the above objects (assume selection set of mixed objects - some multileaders, some text, some blocks)
(defun c:at ( / ss ang *error*)(vl-load-com)(ErrorHandler '("cmdecho" "osmode"))(setvar "cmdecho" 0)(setvar "osmode" 576)(setqss (ssget '((0 . "*TEXT,INSERT")))ang (getangle " Select two points along desired alignment:"))(mapcar'(lambda (x)(vla-put-rotation(vlax-ename->vla-object x)ang))(mapcar 'cadr (ssnamex ss)))(*error* nil))(defun c:test (/ ss ang i sset)(vl-load-com); Tharwat 17. 05. 2011 (if (and (setq ss (ssget ":L" '((0 . "MULTILEADER")))) (setq ang (getangle " Specify Rotation Angle :"))) (repeat(setq i (sslength ss)) (setq sset (ssname ss (setq i (1- i)))) (vla-put-TextRotation (vlax-ename->vla-object sset) ang)) (princ)) (princ))
I have hundreds of drawings I want to run through scriptpro with a script calling 3 different lisp routines. I have the 3 lisps working independantly but can't figure out how to get them to all run in one script.
Two of the Lisps are for redefining the title block in 2 different types of drawings that have different title blocks. The last lisp locks all viewports in all windows. I'll attach the 3 lisps I'm trying to merge in the script. I am not very versed in scripts and lisps so I'm guessing at least 2 of these lisps could be merged into a single lisp...
Here is what I have for the script file contents (which doesn't work):
We are working together whit another firm and we would like to share our tool pallets and lisp routines. The pallets and lisp files we would like to share are quite large so we would like to simply send them a USB stick whit all the files and a title "executable" program that automatically puts them on the right place and changes the appropriate information.
i have created some dynamic title blocks with text attributes in title column. I have gone back an added some more attributes at a later date and these new ones will not move with my dynamic stretch! I have tried everything, modifying the action, re-doing the action, nothing works!
The title blocks that we use have prompted entries in them and I would like to find a way using iLogic to copy the entries from one title block to another within the same drawing; i.e.. if the user decides to change from an A2 to A1 drawing.
I already have an iLogic rule which allows the user to change the active border, title block and sheet size based on a form selection but would like it to capture the prompted entries already entered and re-use them after the change.
I built a building foundation for a grading plan and I have another building that is the exact mirror of it. I have tried to mirror it. Didn't work. I created a block of the feature lines and inserted it with a -1 x value but I can't explode it. I tried the regular explode and xplode. Neither worked. I can use the the block to draw feature lines over but it just seems so much easier if I could figure out how to explode the block.
(defun CELBLKS ( / e blk ss blkl) (setq blkl "" ss (ssadd)) (while (setq e (entsel "
[Code]....
i have this lsp, it works great but how can modify it if i want select with a window.? exemple: if i have 3 differentes blocks, i want to select them with windows and the lisp select all blocks that are identical of those 3.?
I have a project in 3D that I would like to export to Stadd. This requires lines rather than blocks. Is is possible to convert the blocks in the attached dwg file to to lines that are centered on those blocks?
I have a attributed block with multiple attributes (called pkey). In some cases these block attributes will the same values save for one, "Total".
example:
pkey #1 Value AA, Value BB, Value CC, Total 20
pkey #2 Value AA, Value BB, Value CC, Total 30
Is there a way by which I can have AutoCad group these blocks together (when extracted into a table for example) and have the SUM of those "Totals" added together to produce a result such as:
Value AA, Value BB, Value CC, Total 50.
I've explored using fields, but I don't think they work in this case, unless I'm using them wrong.
Just a quick query about Dynamic Blocks. I use dynamic blocks with various visibility states regularly in my drawings. Is it possible to add some kind of custom variable or value to a dynamic block so that I can identify them in automated scheduling?
For example, if I have a dynamic block which represents three variations of very similar machine models is it possible to somehow give each visibility state a value, ie: the model numbers. M100/M125/M150 etc which can then be extrapolated depending which visibility state is active?
Also regarding the limitations of dynamic blocks. Is there a number of visibility states I should not exceed so that the blocks still perform 100%?
In a drawing file customer wants to create 2 title block. both the title blocks should be added to the same drawing. At any point of time only one should be visible to the user. Basically users in one country will see first title block and users in another country will see second title block.
how (if) I can set up my dynamic blocks so that I can set the parameter values as I insert the block, rather than with the grips afterwards?
To take a simple example; I have a block consisting of a rectangle, with 2 linear stretch parameters - length, width. Can I set it up so that when I insert the block, it asks for the length and breadth,just as it would for attributes.
Right now I'm copying it from one file to the other... but I'm sure there is some other way. Are title blocks saved anywhere other than embebed in the file? Autodesk Product Design Suite 2012 Ultimate Autodesk Developer Network [URL]
I’ve been given a drawing with 3 drawings w/title blocks in Paper Space, REV A, B & C. A is on the left, B is in the middle and C is on the right. It appears somebody has been printing REV B as when I select print it jumps straight to that drawing.
How would I print REV A or C? I can do it now but I have to delete the other 2 drawings so it focuses on the only remaining drawing.
When I start the layoutwizard and proceed to the insert title block the only choice I have is none. I have several title blocks created and cannot remember where to tell Cad to look. I just setup a new PC and installed AutoCad 2011.
I need to insert two different (separate) title blocks into my idw drawings so both show on the drawing. One is the real Title block, and one is a Revision History block. I have listed them as Title blocks under Drawing Resources, but Inventor won't allow me to insert both. Is there any way round this?
I do not want the Revision History block as a Symbol.
Inventor 2011; MS Windows 7-64; i5-2500; 8Gb; GF550Ti.
I have trouble modifying the title blocks for the map book templates . Is there a specific folder that I need to save the adjusted title block in. Going through the block editor doesn’t work so I’m exploding the block and once I do that the links have been broken between the title block and map books.
Have more than one drawing template? (we use A and B size sheets)
My questions concerns, metric vs imperial A vs B vs C etc etc drawing sheet size title block does not scale down accordingly when change sheet size within an existing drawing template.
Is it possible to have one drawing template that can be toggle imperial vs metric, and then sheet size selected and then the title block scaled down or up accordingly? (I would assume this could be done using iLogic)
Or is it normal to have different drawing templates for sizes and units?
i was wondering if it's possible to change the default precision of values in the drop down menu for linear parameters when using a block properties table from 4 digits to 0.
See attached file, when opening the dropdown menu, the centre-to-centre widths of the chair are displayed in a value with 4 digits "behind the comma" and i would like that to be 0.
Say I have a block that contains two attributes, one contains a value that is a number and another contains a value that is letters. I have many of these blocks placed in a drawing, could you create a lisp that would return the sum of the number value and return it to the command line along with the letter value. Something like this: