Search the Community
Showing results for tags 'field code'.
-
Using a Field Expression inside a Field Expression
Sambo posted a topic in AutoLISP, Visual LISP & DCL
Hey Guys, I have created a bunch of lisp variables that look something like this "StageArea1", "StageArea2", ect What im wanting to do is create a field formula that links to these variable, but i want whatever area value it calls to be determined by the contents of a piece of text. My initial thoughts where something like this(or some variation of it): %<\AcVar.17.0 Lisp.StageArea(%<\AcObjProp Object(%<\_ObjId 2228256557344>%).TextString>%)>% With %<\AcObjProp Object(%<\_ObjId 2228256557344>%).TextString>% calling the contents of my piece of text, but this doesn't seem to work when i plug it into a Formula inside the field dialog box. Does anyone have any other ideas on how to do this?- 6 replies
-
- field code
- fields
-
(and 1 more)
Tagged with:
-
I made below lisp code to have field code copied to text,dim etc. but not work on ATT thing anyone could help me with this how to make it happen that copy field code to ATT? :) (defun c:ffd () (progn (setvar "cmdecho" 0) (setvar "blipmode" 0) (vl-load-com) (progn (setq ent (entsel "select text to be copied:")) (setq egg (cdr (assoc 0 (entget (car ent))))) (setq entx (vlax-ename->vla-object (car ent))) (cond ((= egg "INSERT") (setq entp (entget (car (nentselp (cadr ent))))) (setq entr (cdr (assoc -1 entp))) (setq objid (vla-get-objectid (vlax-ename->vla-object entr))) (setq field (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).TextString>%")) ; %<\AcObjProp Object(%<\_ObjId 8796059764128>%).TextString>% ; %<\AcObjProp Object(%<\_ObjId 8796083319744>%).TextString>% ) ((= egg "DIMENSION") (setq objid (vla-get-objectid entx)) (setq field (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa objid) ">%).Measurement \\f \"%lu2\">%")) ) ) ;%<\AcObjProp Object(%<\_ObjId 8796059773904>%).Measurement \f "%lu2">% (setq ent1 (entsel "copy to:")) (setq egg1 (cdr (assoc 0 (entget (car ent1))))) (setq entx1 (vlax-ename->vla-object (car ent1))) (cond ((= egg1 "INSERT") (setq entp (entget (car (nentselp (cadr ent1))))) (setq entr (cdr (assoc -1 entp))) (vla-put-TextString (vlax-ename->vla-object entr) field) ) ((OR (= egg1 "TEXT") (= egg1 "MTEXT")) (vla-put-textstring entx1 field) ) ((= egg1 "DIMENSION") (vla-put-TextOverride entx1 field) ) ) ) ) )
- 3 replies
-
- field code
- attribues
-
(and 1 more)
Tagged with:
-
I am having trouble finding a reference for how to use field code. I am trying to create a custom fied in MTEXT that will only display the 1st 25 characters of a filename. I can't find any good resources to explain how field code in AutoCAD works on the web or in the AutoCAD help.