Layout Expression as a Field Text

Layout Expression as a Field Text

F.Camargo
Advisor Advisor
506 Views
15 Replies
Message 1 of 16

Layout Expression as a Field Text

F.Camargo
Advisor
Advisor

Hi guys!
How are you?

I am trying to get a lisp to get that result automatically.

FCamargo_0-1750772453267.png

 

Does anyone could help me please?

Thanks
Fabricio

0 Likes
Accepted solutions (2)
507 Views
15 Replies
Replies (15)
Message 2 of 16

Moshe-A
Mentor
Mentor

@F.Camargo hi,

 

To make it clear...you want to change a text in drawing and this will drag a change to layout name?

Message 3 of 16

F.Camargo
Advisor
Advisor

Hi @Moshe-A 

Its better to change the text in drawing to get the same properties.

After that, I am gonna copy a layout and that field is updated automatically, right?

0 Likes
Message 4 of 16

Moshe-A
Mentor
Mentor

@F.Camargo ,

 


@F.Camargo wrote:

Hi @Moshe-A 

Its better to change the text in drawing to get the same properties. - what's that?

After that, I am gonna copy a layout and that field is updated automatically, right? - easy mate...😀

one thing is clear, a link between the text and a layout must be made each time you create\copy a new layout or text.

 

Moshe

 

 

 




 

 

Message 5 of 16

BlackBox_
Advisor
Advisor

Consider using a DieselExpression for your Field: 

 

Previous: $(-,$(substr, $(getvar, ctab), $(strlen, $(getvar, ctab))),1)
Current: $(substr, $(getvar, ctab), $(strlen, $(getvar, ctab)))
Next: $(+,$(substr, $(getvar, ctab), $(strlen, $(getvar, ctab))),1)

 

Adjust the DieselExpression for double-digit values as needed. 


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

Message 6 of 16

F.Camargo
Advisor
Advisor

@BlackBox_  escreveu:

Consider using a DieselExpression for your Field: 

 

Previous: $(-,$(substr, $(getvar, ctab), $(strlen, $(getvar, ctab))),1)
Current: $(substr, $(getvar, ctab), $(strlen, $(getvar, ctab)))
Next: $(+,$(substr, $(getvar, ctab), $(strlen, $(getvar, ctab))),1)

 

Adjust the DieselExpression for double-digit values as needed. 


Amazing!! Thanks

How can I create a formula to increase or decrease a value everytime that I create a new layout.

Total Layouts:

 

0 Likes
Message 7 of 16

F.Camargo
Advisor
Advisor

How can I get that value?

FCamargo_0-1750782775643.png

 

0 Likes
Message 8 of 16

BlackBox_
Advisor
Advisor
Accepted solution

Not sure that I understand what you're asking for, and you've only posted images.

 

I've provided a DieselExpression for each attribute of your Block, where the Diesel code extracts a substring of the current Layout's name (CTAB sysvar), then increments it up/down by 1. 

 

In your Block, populate the active Layout's attribute (6) with a Field using this DieselExpression: 

$(substr, $(getvar, ctab), $(strlen, $(getvar, ctab)))

 

Populate the Previous attribute (6-1) with a second Field using this DieselExpression: 

$(-,$(substr, $(getvar, ctab), $(strlen, $(getvar, ctab))),1)

 

Populate the Next attribute (6+1) with a third Field using this DieselExpression: 

$(+,$(substr, $(getvar, ctab), $(strlen, $(getvar, ctab))),1)

 

Once those are added to your Block, it's now relative to the current Layout (CTAB)... now you can copy + paste it to other Layouts and regen. 

 

HTH

 

2025-06-24_13-24-47.png


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

Message 9 of 16

F.Camargo
Advisor
Advisor

amazing solution!! Thanks!!

Previous and Next FIELD is awesome!!

FCamargo_0-1750786259647.png

 

 

How about a custom one?

FCamargo_1-1750786356930.png

 

FCamargo_2-1750786439719.png

Is it possible to create a Field to increase or decrease valeu everytime a create a new layout?

Thanks

 

0 Likes
Message 10 of 16

BlackBox_
Advisor
Advisor

I'm glad it worked for you!

 

The DieselExpression is dependent on CTAB sysvar (aka the Layout name) - so if you copy the Block to another Layout, and REGEN, the Fields will update relative to the new CTAB value. 

 

This will also work if you copy the Layout and rename it. 

 

If that's not what you're looking for, please post a drawing with your Block, Layouts, and a better description of what you're after. 

 

Cheers


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

Message 11 of 16

F.Camargo
Advisor
Advisor

@BlackBox_ 

 

That was exactly I was looking for! But I need to do one more thing.

 

I am gonna attached a file to explain better.

Thanks

0 Likes
Message 12 of 16

BlackBox_
Advisor
Advisor

@F.Camargo wrote:

@BlackBox_ 

 

That was exactly I was looking for! But I need to do one more thing.

 

I am gonna attached a file to explain better.

Thanks


Insert Field, Object, pick the Object, Contents: 

 

2025-06-25_07-32-17.png

 

The object must be in the same space (Model/Layout), so simply change space, add the Field, then change space back to where it was. 

 

When you get a bit more experience, you can even use a LISP to map the Field's code to the ObjectId of the object programmatically. 

 

Cheers


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

Message 13 of 16

F.Camargo
Advisor
Advisor

FCamargo_0-1750851945198.png

Can I get a field contents on layout "Lote nº 2" to a field formula on "Lote nº 3"?

 

Lote nº 3 - value = 20

Lote nº 4 - value = 19

0 Likes
Message 14 of 16

BlackBox_
Advisor
Advisor

Add Field, select Formula, right click to insert FieldAdd Field, select Formula, right click to insert FieldThis Field should reference the Object contentsThis Field should reference the Object contentsThen increment up/downThen increment up/downEt voilàEt voilà


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps

Message 15 of 16

F.Camargo
Advisor
Advisor

How can I do to get 20 text field from a previously layout?

 

FCamargo_0-1750864954576.png

This is the result for the field to each layout tab

0 Likes
Message 16 of 16

BlackBox_
Advisor
Advisor
Accepted solution

@F.Camargo wrote:

How can I do to get 20 text field from a previously layout?

 

FCamargo_0-1750864954576.png

This is the result for the field to each layout tab


Change your increment... instead of plus (+) or minus (-) 1, maybe you need 2 or 3... you control the result by modifying the formula.


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D ~ Autodesk Exchange Apps