Field Code Formatting Codes

Field Code Formatting Codes

Kyudos
Advisor Advisor
2,547 Views
7 Replies
Message 1 of 8

Field Code Formatting Codes

Kyudos
Advisor
Advisor

I can't seem to find any comprehensive documentation of AutoCAD field formatting codes - all I seem to be able to discover is what third partties have 'worked out'.

 

Does anyone have a full specification? It's hard to come up with custom formats otherwise...

0 Likes
2,548 Views
7 Replies
Replies (7)
Message 2 of 8

devitg
Advisor
Advisor

Maybe it can help. From field and lisp

0 Likes
Message 3 of 8

Kyudos
Advisor
Advisor

Sorry for necro'ing this thread but...

 

I've had cause to look for this again, and still can find anything from AutoDesk 5 years later.

I mean, it seems pretty crucial to the use of field expressions - is there a reason AutoDesk haven't documented it?

 

 

0 Likes
Message 4 of 8

hak_vz
Advisor
Advisor

Check this link for more detailed fields format explanation.

There is no official documentation about this.

 

https://blog.bricsys.com/customizing-bricscad-coding-with-field-text-p20/ 

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 5 of 8

Kyudos
Advisor
Advisor

Thanks I did see that page, it's useful, but not complete...e.g.:

 

"%qf is used by scale factors, but employs values I haven’t figured out yet"

 

I still don't understand why a years-old feature has zero documentation. How do AutoCAD expect people to use it?

 

 

Message 6 of 8

Anonymous
Not applicable

The only real way is do it manually and look at the string produced. Took ages to work out add multiple fields for attribute in block, was very simple in the end. 

0 Likes
Message 7 of 8

le-tan-phuc
Enthusiast
Enthusiast

thank you so much
I was happy to finally find the tutorial through your suggestion

0 Likes
Message 8 of 8

Sea-Haven
Mentor
Mentor

This took a while to work out add 2 attribute vales then put answer in a 3rd attribute, could be like att1 = length att2 = height att3 = area a "*" instead of "+".

; add 2 attributes and put the value as a field into the 3rd attribute.
; BY AlanH

(defun c:test ( / obj lst x )
(setq oldatt (getvar 'attdia))
(setvar 'attdia 0)
(command "-insert" "c" (getpoint "\npick point") 1 1 0 (getstring "\nEnter Att1 ") (getstring "\nEnter Att2 ") (getstring "\nEnter Att3 ") "-")
(setq obj (vlax-ename->vla-object (entlast)))
(setq lst '())
(foreach att (vlax-invoke obj 'getattributes)
(princ  "\n")
(setq lst (cons  (strcat "%<\\AcObjProp Object(%<\\_ObjId " 
(vlax-invoke-method (vla-get-Utility  (vla-get-activedocument (vlax-get-acad-object))) 'GetObjectIdString att :vlax-false)
">%).Textstring>%"
 ) lst ))
)
(setq str nil)
(setq x (length lst))
(setq str (strcat "%<\\AcExpr "
(nth (setq  x (- x 1)) lst) " + "
(nth (setq  x (- x 1)) lst) " + "
(nth (setq  x (- x 1)) lst) ">%"
)
)
(setq x 1 y 4)
(foreach att(vlax-invoke obj 'getattributes)
(if (= x y)
(Vla-put-textstring att str)
)
(setq x (+ x 1))
)
(setvar 'attdia oldatt)
(princ)
)
(c:test)


0 Likes