Hello,
Please we need the official Documentation about using formulas inside fields.
We have a field with page numbering, a Layer XX of YY Field. Render is "Page 01/50", "Page 02/50", ...
So we need Documentation and Examples about $if(condition,"case_1","case_2"), please.
Our Layer Tabs are named F-A3, F-A3 (2), F-A3 (3), etc. because in our Template we have only 1 layer, nammed F-A3 then we copy each layer to print further the drawing.
$(strlen,$(getvar,ctab) Works shows length of string of current tab name
$(strlen,$(getvar,ctab),8) Works shows length of string of current tab name, with useless parameter "8"
$(substr,$(getvar, ctab),7,1) Works shows 1 caracter beginning at 7th caracter in current tab name
$(substr,$(getvar, ctab),7,2) Works shows 2 caracters beginning at 7th caracter in current tab name
$(if,$(=,$(strlen,$(getvar,ctab),4),"case_1","case_2")) X Doesn't work Should show "case_1" if current tab name length is "4" or else should show "case_2"
$(if,$(<,$(strlen,$(getvar,ctab),9),"case_1","case_2")) X Doesn't work Should show "case_1" if current tab name length is less than "9" or else should show "case_2"
$(if,$(<,$(strlen,$(getvar,ctab),9),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2))) X Doesn't work Should show "1 caracter beginning at 7th caracter in current tab name" if current tab name length is less than "9" or else should show " 2 caracters beginning at 7th caracter in current tab name" . Example "2" out of "F-A3 (2)" else "12" out of "F-A3 (12)".
Finaly it would be nice to get total number of layer tabs (total number of pages) "Page $current tab/$count of tabs"). Currently we created a custom Total Count of Layers Property in Template then we mannually update it in each drawing.
Regards
Solved! Go to Solution.
Hello,
Please we need the official Documentation about using formulas inside fields.
We have a field with page numbering, a Layer XX of YY Field. Render is "Page 01/50", "Page 02/50", ...
So we need Documentation and Examples about $if(condition,"case_1","case_2"), please.
Our Layer Tabs are named F-A3, F-A3 (2), F-A3 (3), etc. because in our Template we have only 1 layer, nammed F-A3 then we copy each layer to print further the drawing.
$(strlen,$(getvar,ctab) Works shows length of string of current tab name
$(strlen,$(getvar,ctab),8) Works shows length of string of current tab name, with useless parameter "8"
$(substr,$(getvar, ctab),7,1) Works shows 1 caracter beginning at 7th caracter in current tab name
$(substr,$(getvar, ctab),7,2) Works shows 2 caracters beginning at 7th caracter in current tab name
$(if,$(=,$(strlen,$(getvar,ctab),4),"case_1","case_2")) X Doesn't work Should show "case_1" if current tab name length is "4" or else should show "case_2"
$(if,$(<,$(strlen,$(getvar,ctab),9),"case_1","case_2")) X Doesn't work Should show "case_1" if current tab name length is less than "9" or else should show "case_2"
$(if,$(<,$(strlen,$(getvar,ctab),9),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2))) X Doesn't work Should show "1 caracter beginning at 7th caracter in current tab name" if current tab name length is less than "9" or else should show " 2 caracters beginning at 7th caracter in current tab name" . Example "2" out of "F-A3 (2)" else "12" out of "F-A3 (12)".
Finaly it would be nice to get total number of layer tabs (total number of pages) "Page $current tab/$count of tabs"). Currently we created a custom Total Count of Layers Property in Template then we mannually update it in each drawing.
Regards
Solved! Go to Solution.
Solved by TomBeauford. Go to Solution.
Solved by pendean. Go to Solution.
Hi,
this is DIESEL and has nothing to do wie fields (but you can use it in Diesel-fields, of course).
DIESEL is documented [F1] , well enough for this basic stuff (just a help documentation. Not a tutorial)
Variable for total layouts and also current layout in order would be good, i am with you.
Sebastian
Hi,
this is DIESEL and has nothing to do wie fields (but you can use it in Diesel-fields, of course).
DIESEL is documented [F1] , well enough for this basic stuff (just a help documentation. Not a tutorial)
Variable for total layouts and also current layout in order would be good, i am with you.
Sebastian
To get layout numbers as a field but using lisp the following thread may be of interest to you:
To get layout numbers as a field but using lisp the following thread may be of interest to you:
@Jacques_V_ wrote:
Hello,
Please we need the official Documentation about using formulas inside fields....
FIELD command is covered in AutoCAD's HELP, I'll get you started with the online HELP version here
DIESEL is what you are using and posting about though, which can be used in FIELDs and MTEXT and block ATTRIBUTES too. AutoCAD's HELP guidance is a good place to start, I'll help you out with an online link too, it starts here
https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-76B3F3D3-6B9A-43E7-BE2C-D4B39AC3FBCF
HTH
@Jacques_V_ wrote:
Hello,
Please we need the official Documentation about using formulas inside fields....
FIELD command is covered in AutoCAD's HELP, I'll get you started with the online HELP version here
DIESEL is what you are using and posting about though, which can be used in FIELDs and MTEXT and block ATTRIBUTES too. AutoCAD's HELP guidance is a good place to start, I'll help you out with an online link too, it starts here
https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-76B3F3D3-6B9A-43E7-BE2C-D4B39AC3FBCF
HTH
Thank you all for your help.
So the direct link is :
https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-F94A885A-4DA2-432B-AC1A-EB49CC6C1C72
An alternative link, with some minor differences is :
https://www.fourmilab.ch/diesel/
There and There I read :
$(if, expr, dotrue [, dofalse])
and
$(IF,expr,dotrue,dofalse)
Then, I could solve :
Current Tab number (only if 8 or 9 caracters in the tab name, i.e. F-A3 (n) or F-A3 (nn) :
$(IF,$(=,$(strlen,$(getvar,ctab)),8),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2))
Previous Tab number (current tab -1) :
$(-,1,$(IF,$(=,$(strlen,$(getvar,ctab)),8),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2)))
Following Tab number (current tab +1) :
$(+,1,$(IF,$(=,$(strlen,$(getvar,ctab)),8),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2)))
Thanks again,
Regards
Thank you all for your help.
So the direct link is :
https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-F94A885A-4DA2-432B-AC1A-EB49CC6C1C72
An alternative link, with some minor differences is :
https://www.fourmilab.ch/diesel/
There and There I read :
$(if, expr, dotrue [, dofalse])
and
$(IF,expr,dotrue,dofalse)
Then, I could solve :
Current Tab number (only if 8 or 9 caracters in the tab name, i.e. F-A3 (n) or F-A3 (nn) :
$(IF,$(=,$(strlen,$(getvar,ctab)),8),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2))
Previous Tab number (current tab -1) :
$(-,1,$(IF,$(=,$(strlen,$(getvar,ctab)),8),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2)))
Following Tab number (current tab +1) :
$(+,1,$(IF,$(=,$(strlen,$(getvar,ctab)),8),$(substr,$(getvar, ctab),7,1),$(substr,$(getvar, ctab),7,2)))
Thanks again,
Regards
I've used Lee Mac's code for this in building my layout template blocks https://lee-mac.com/layoutfield.html
I added a function just for the sheet number to the code and autoload it with acaddoc.lsp.
;|----------------------------------------------------------------------
Layout Number
Generates a field expression referencing the position of the layout in which the selected annotation object resides.
----------------------------------------------------------------------|;
(defun c:lfnumber ( )
(layoutfield
'(lambda ( obj )
(vla-put-textstring obj
(strcat
; "Sheet "
"%<\\AcObjProp Object(%<\\_ObjId "
(LM:objectid (layoutfield:layout obj))
">%).TabOrder>%"
)
)
)
)
)
;|----------------------------------------------------------------------
Total Sheets
I've used Lee Mac's code for this in building my layout template blocks https://lee-mac.com/layoutfield.html
I added a function just for the sheet number to the code and autoload it with acaddoc.lsp.
;|----------------------------------------------------------------------
Layout Number
Generates a field expression referencing the position of the layout in which the selected annotation object resides.
----------------------------------------------------------------------|;
(defun c:lfnumber ( )
(layoutfield
'(lambda ( obj )
(vla-put-textstring obj
(strcat
; "Sheet "
"%<\\AcObjProp Object(%<\\_ObjId "
(LM:objectid (layoutfield:layout obj))
">%).TabOrder>%"
)
)
)
)
)
;|----------------------------------------------------------------------
Total Sheets
Can't find what you're looking for? Ask the community or share your knowledge.