Does anyone have a diesel expression that would read a layout tab? for example if i have a layout tab names 244180101 I would need it to read the last 2 digits in the layout tab.
Solved! Go to Solution.
Solved by Charlie.Ogden. Go to Solution.
You might explore a different method using an AutoLISP variable. You could have a routine either populate a custom property in the dwg properties. This routine could be added to your startup routine. If the dwg properties are out, the routine could populate a set of variables at dwg load.
AutoLISP or Visual LISP could do the varying string lengths within the ctab name you are searching for.
I am trying to use a field to get the "ctab" and add a variable to it to populate the field with different letter. Like "P02.00A-UG" +3 to get "P02.00D-UG".
I think I am accomplishing this with 3 fields.
The first returns the static prefix from the tab name $(substr,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)),9),6)
The third returns the static suffix from the tab name $(substr,$(getvar,ctab),$(-,$(strlen,$(getvar,ctab)),2),3)
The second I want to read the 7th character (letter) from the tab name and count up or down by a variable can modify later.
any ideas?
A deisel expression can't include Autolisp code directly. But if you were to create a lisp routine that runs when you OPEN the file, the routine could store the info in the setvars USERS1, USERS2 etc (if I remember correctly, there are 5 of them). Then your lisp routine could read the value of the appropriate variable using the getvar deisel function.
Don Ireland
Engineering Design Technician
Hi all,
I'm glad I found this thread. The solution was half of the answer I was looking for.
Here's my question: Is there a way to tell the DieselExpression to start from the beginning of the layout name, but exclude the last three characters?
Thanks for any and all help.
Don Ireland
Engineering Design Technician
Awesome, did some searching and got what I wanted!
$(substr,$(getvar,ctab),1,$(-,$(strlen,$(getvar,ctab)),3))
Thanks all!
I just want this code in this thread for the next time I search for it.
This is for matchline referencing layout name plus adding or subtracting one number.
Left
$(-,$(getvar,ctab),1)
Right
$(+,$(getvar,ctab),1)
I have plan production with two plan viewports.
I'm trying to get my title block to display
sta (beginning sta # in plan viewport 1) ~ sta (end sta # in plan viewport 2)
The stations are also in the matchlines, in model view.
Right now I have my tab/ sheet/ layout name displaying sta (beginning sta # in plan viewport 1) ~ sta (end sta # in plan viewport 2). The title block is pointing to this layout name. I'm wondering if I just need a custom code instead.
Are there formulas for pointing to a second viewport?
I've attached a screenshot.
I want to share my Solution
My Layout name is SHEET 425 CH. 134+720.00 CH. 134+980.00 to run Diesel Express First is Extraction Layout page Number with that Value of 5 and 7 to fix in my template Page well be wo090-8802-03-01 page 426
PREVIOUS PAGE WO090-8802-0301 PAGE $(+,$(substr,$(getvar,ctab)5,7,$(-,$(strlen,$(getvar,ctab)5,7),2),3),1)
CURRENT PAGE....WO090-8802-0301 PAGE $(substr, $(getvar,ctab), 7, 5)
NEXT WO090-8802-0301 PAGE $(-,$(substr,$(getvar,ctab)5,7,$(-,$(strlen,$(getvar,ctab)5,7),2),3),1)
on Diesel expression I just Added Prefix project name
i Got Correctly what i wanted to fix in my Project
Hello @henry_lozano ,
Glad to hear you fixed the problem and thanks so much for sharing the solution!
You solution is close to what I am looking for but I can't seem to make it work for me.
What I am trying to accomplish is using the previous tab's name in my mtext and the next tab's name in another piece of mtext.
Could someone please assist with this?
Thanks, Mike
Hi, so sorry.
The code (diesel expression) should be typed as a field insert, into the default value of your block attribute.
then you’ll need to ATTSYNC the block and REGEN.
Thanks my problem is solved!
Now, can I define a dynamic attribute that can read a text such as a kilometre like this from Excel or something!?
Actually, I have a lot of layouts and each layout has a unique kilometre how can define a field to read text from Excel !
this kilometre is not a value of attribute I wrote it manually for each layout separately!
but now I am looking for a way that I can arrange it automatically!
Can't find what you're looking for? Ask the community or share your knowledge.