AutoCAD Visual LISP / AutoLISP :: How To Create Layer Name In Attributes String Value
Oct 15, 2013
How i can filter attributes string value.
How i set the layer name is = attributes string value.
Example:
A attributes string value is R8 .all these string is set the layer name is same string value(R8).
View 1 Replies
ADVERTISEMENT
Nov 16, 2012
i failed to find one which would change string of a text to other for all types of objects. I mean it was usually either only multitext, or only text, dimensions or attributes.creating one which would change in abt 200 drawings:
-001
-002
-003
to:
-00001
-00002
-00003
in attributes, text, multittext, leaders, multileaders, dimensions..... at the same moment?
It is meant to be used in ScriptPro (by loading lisp in script).
If not possible, then can also open each file and run the lisp in each of them - still would save lot of time.
View 4 Replies
View Related
Sep 12, 2013
I have searched the web and the Autodesk Discussion Group for a LISP Routine that allows me to convert all attributes in a drawing to Layer 0 but i have had no luck. It would be great if the LISP could edit xrefs as well although not sure if this is possible.
**BATTMAN command will take too long for the hundreds of blocks, xrefs and drawings i need to edit.
View 2 Replies
View Related
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
Jan 4, 2012
i am trying to restrict users from modifying certain attributes in a block,i can create the blocks with some of the attributes on locked layers, but then autocad pops up an annoying alert box, is there a way to disable this? the other option i can think of is to redefine the commands *ddedit, *attedit, *ddatte,*attipedit,
View 5 Replies
View Related
Nov 16, 2012
I am looking for a way to create a master list of construction notes then use blocks attributes with fields to link to that master list. That way if the master list changed the note bubbles would change as well.
Sheet sets are being used with this project but I can't think of a way to make it work with the existing sheet set technology.
View 1 Replies
View Related
Nov 14, 2013
I have a list ("temp.dwg" "temp2.dwg") and would like to add the string "insert text here" into each item in the list resulting in ("insert text heretemp.dwg" "insert textheretemp2.dwg"). how would i go about doing that using LISP?
View 2 Replies
View Related
Jun 6, 2012
I have a list that is "acl", I would like to convert it to a string "acl", everything that I have read uses alot of code. Does this really take that much code to do?
View 9 Replies
View Related
Jul 11, 2013
Here's one that I could use on that i can't figure out:
I have a list of a bunch of descriptions that looks like this:
("00.02.00" "CTD01 Mainframe PT1 (top)" "GD01")
What I am doing is grabbing the middle item and i need to break this up into 2 lines. So, my code below grabs the first 3 "words" in the second item in the list and puts them in a list, but I need to convert this back to a string.
(setq desc6a (list (car (read (strcat "(" (cadr input6) ")" )))(cadr (read (strcat "(" (cadr input6) ")" ))) (caddr (read (strcat "(" (cadr input6) ")" )))))
I tried a bunch of ways but can't get it
View 8 Replies
View Related
Apr 13, 2013
Lisp file that create a layout for each layer,I’m looking for a lisp file that creates layout for each layer instead of doing this manually.
Software: AutoCAD 2014, AutoCAD C3D, AutoCAD M3D, Revit
Windows 7 (Ultimate 64 bits),
Firefox 20.0,
Kaspersky 2013.
View 7 Replies
View Related
Nov 15, 2013
who can share with me a lisp which can create layer by xrefs and blocks ( if this can be an optional , would be nice ) ?
even maybe lisp can create layer group filter with "XREF" group name and move layers to inside.
View 4 Replies
View Related
Feb 22, 2012
I am trying to make this: L:Engineering-208037SURVEYDRAWINGS turn into this: L:Engineering-208037DRAWINGS
I am using the dwgprefix and it returns the first string and i want to make it in the second string as a new variable or replace the old variable so i can use it in a save as routine i am working on.
The problem is sometimes them project number (0208037) will be longer or shorter so i can't use the substr command
View 6 Replies
View Related
Aug 20, 2013
I'm looking for a function to return the actual text from an mtext object.if there's a carraige return I wish to replace it with a space.
View 4 Replies
View Related
Aug 31, 2012
acad_strlsort will sorts strings, but what if my list looks like
("1" "2" "3" "10" "11" "12" "20")
i am sure i have seen it done ina simple way using vl-sort or vl-sort-i
but am not able to find...
View 5 Replies
View Related
Nov 18, 2011
I've been working on a lisp to set up basic settings such as text styles, dim styles, discipline specific layers and things of that nature.
I have a prompt to ask for a discipline designator as a string. I want to have an If statement or a conditional to read that string and check for a "C" if it finds it I want to have it set up a dimstyle to decimal feet ect and if not do it as architectural units.
This is just a test lisp that I'd like to add to the main one listed above...
(defun c:test(/ disc dsnm dsna)
(setq disc (getstring "
Discipline (G,C,S,M,E,CP): ")) ;Prompt for Discipline
(setq ds (getint "
Dimscale Factor: ")) ;Prompt for Dimscale
[code].......
View 6 Replies
View Related
Jul 9, 2013
I would like to use a string as a variable if this is possible. I've got:
new-pl-lay (as a variable that holds layer name "UGL_PL_NEW")
first-cable (as a string that holds "new-pl-lay")
I'd like set the current layer to "UGL_PL_NEW" by using the first-cable string.
Something like:
(command "_.layer" "m" (read first-cable) "")
View 8 Replies
View Related
Aug 30, 2011
I'm working on a LISP function that adds a predetermined string to each layername in the dwg.
I came up with this:
(SETQ prefix "A-_82-_")
(TBLNEXT "LAYER" T)
(WHILE (SETQ la (TBLNEXT "LAYER"))
(SETQ old (ASSOC 2 la)
new (CONS 2 (STRCAT prefix (CDR old)))
[Code] .....
The line (princ "
la is: ")(princ la) (princ "
") is thrown in to enable me to see the result of the while function, and is to be removed from the final version.
Now, everything seems to work fine, as the princ shows on the acad textstcreen.
Yet, when I check the layer palette, all layernames remain unchanged.
My guess is that I should use some other function then ENTMOD or ENTUPD to change the layertable, but I'm at a bit of a loss as to which function is required.
View 3 Replies
View Related
Dec 20, 2013
I have a lot of attribute blocks in my drawing which i want to move them one by one
so , here is what i want to do :
I have numbers (or texts) in my work area and this numbers also exist in my attribute blocks .. i wanna move my attribute blocks with tag name value reference to my specify area if tag name values are matching with text or numbers in this area .. every block will check my selected tag string and will be move on matching text in my work area.
View 5 Replies
View Related
Jul 17, 2012
I have a list of (0 .4 .8 0 10). I want to convert every element of the list to string.
View 4 Replies
View Related
Jun 11, 2007
In order to avoid duplicate text string in different places in the same drawing, I would like to have such a tool to find duplicate text string.
For instance, I want to put numbering of some connection lines, I do not want to have different lines but have same number by mistype.
View 9 Replies
View Related
Feb 24, 2013
I have a TitleBlock than contains more than 50 attributes inside itself.
I want to prepare a lisp code to GetTagString when I clicking on one attribute inside a BLOCK.
I prepare a code to get Block name when I ckick on a block:
(defun GetBlockName ( / obj)(defun sel_Obj( / sel)(While (=(setq sel (car (entsel "
choose a "BLOCK": ")))nil)(prompt "You didn't select any object!"))sel)(While (not (eq (vla-get-ObjectName (setq obj (vlax-ename->vla-object (sel_Obj)))) "AcDbBlockReference"))(prompt "That was not a "BLOCK"!"));;while (vlax-get-property obj (if (vlax-property-available-p obj 'EffectiveName) 'EffectiveName 'Name)) ) ;;usage: ;;(GetBlockName) ;;RESULT: ;;
just Selected Block Name Something like this but just for TagString of attribute is my desired!
View 3 Replies
View Related
Oct 24, 2011
I am using a variable that is being called up from a .csv file for a file name. By default this variable automatically includes a comma due to it being called from a .csv.
How to remove a character ( , ) from a variable? I'm not sure if this is along the right line or not, but i used the READ function to read the variable as a string (i think thats how it works?).
View 9 Replies
View Related
Jun 11, 2012
I would like to know how I can compare the value of a variable to a set string of text if the two prove to be equal perform task A if the two prove different perform task B?
View 7 Replies
View Related
Feb 18, 2013
I write a code to replace strings in one string.for example
str="AutoDesk, AutoCAD, 2013, Electrical, 64Bit"
patt=", "
NewStr=" - "
==> result: "AutoDesk - AutoCAD - 2013 - Electrical - 64Bit"
;;replaces NewStr instead of Patt(s) in Str string(defun ReplaceStr (NewStr Patt Str)(While (> (vl-string-search ptt str) 0)(setq Str (vl-string-subst NewStr patt Str)) );;whilestr) ; usage;(ReplaceStr " - " ", " "AutoDesk, AutoCAD, 2013, Electrical, 64Bit")
==> result= ; error: bad argument type: (or stringp symbolp): nil
View 9 Replies
View Related
Oct 18, 2011
I need a lisp routine that will add or subtract to modify a value in a text string. Its used for drainage fixture units on waste & vent plans. Example: We use basic dtext strings that look like this [color=red]4"(6)[/color]I would like to be able to add or subtract to the number that is [b][size=12pt]ONLY[/size][/b] in parenthesis and would like to be able to pick multiple text strings at one time so it would result in something like this: [color=green]4"(6)[/color] + 9 will become [color=blue]4"(15)[/color].
View 9 Replies
View Related
Feb 10, 2013
i have in Drive C a file "Steel.lsp" have function called IPE
in this function have this line
(setq n (getstring "
Enter IPE Height :"))
i loaded it
i created a menu and command in it called "Amr"
no i need when i click Amr Run IPE with string 270 then click enter
i need all this happen automaticlly when i click on "Amr" on menu
how???
View 2 Replies
View Related
May 2, 2012
I have spent the last three days writing a lisp program that will copy a text string from one text file and paste it into another. I have tried using the write-string, getstring, prin1, princ and print functions with no success.
View 6 Replies
View Related
Sep 12, 2011
There is a lisp function to replace all occurrences of a character within a string?
In short, as the Replace command in Visual Basic
For example, to replace all "x" to "*":
"34x59+60x3" -> "34*59+60*3
View 6 Replies
View Related
Sep 23, 2011
I want to create a layer from selecting only some words from an mtext or text entitty.
Is it possible to highlight and select only part of the text from an mtext using a lisp routine ? similar to how Adobe Reader can select text.
View 7 Replies
View Related
Aug 6, 2013
I have this interresting problem, it occured just here, in other situations, the script works fine.
I am counting length from coordinates:
Command: (setq bod1 ppo_bod1)(-0.821965 -1.7232 0.0)Command: (setq bod2 ppo_bod2)(25.428 13.1268 0.0)Command: !mfac0.025Command: (setq x (atoi (rtos(/ (abs (- (car bod2) (car bod1))) mfac))))1050Command: (setq y (atoi (rtos(/ (abs (- (cadr bod2) (cadr bod1))) mfac))))593Command: (- (cadr bod2) (cadr bod1))14.85Command: (/ (abs (- (cadr bod2) (cadr bod1))) mfac)594.0Command: (rtos(/ (abs (- (cadr bod2) (cadr bod1))) mfac))"593.99999998"Command: (atoi (rtos(/ (abs (- (cadr bod2) (cadr bod1))) mfac)))593
As you can see, the conversion from 594.0 (real) to string causes an inaccuracy, which is strange, because the length really is 594.0
View 3 Replies
View Related
May 30, 2012
Is there a way to apply a single string value "Phase1", or "Phase2" to all layers in a drawing? I though about exporting a Layer State, modifying it in Excel, then re-importing the layer state, but, Layer States don't store a value for "Description."
I'm creating a consolidated map from several drawings, but I'd like to be able to separate the layers from each drawing. Description seems like a good value to populate and be able to sort by in the Layer Manager.
View 3 Replies
View Related