Community
Dynamic Blocks Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

diesel expression that read object lenght

4 REPLIES 4
Reply
Message 1 of 5
Nirand
1086 Views, 4 Replies

diesel expression that read object lenght

Hi,

Sorry for my bad english...

I created a dynamic block with text field that show the lenght of a line, but this line can be 0 and in that case I want that the text field will show nothing instead of "0".

I try to write it in diesel expression with if command but i don't know how to bring the object lenght into the diesel expresion code.

 

Does anyone know the answer?

 

thanks.

4 REPLIES 4
Message 2 of 5
pendean
in reply to: Nirand

There is no option to do that with DIESEL: length cannot be nothing, so zero is displayed.
Are you controlling the line length with preset increments?
Message 3 of 5
Nirand
in reply to: pendean

I change the line with stretch parameter but sometimes I dont want the line (and is length) to be shown so it change to zero.

I also try to do it with dimension but it's also show zero. Do you have another idea? 

Message 4 of 5
AcadAdamLT
in reply to: Nirand

If it's extremely important that at "0" no attribute is shown then you can make a little bypass method.

If your currently not using any BPT or Visibility then this will work.

Set your stretched line to increment "1".

Then set up a visibility with 2 VIS-states. One with the attribute and one without. lets call them, Zero and Text

 

1. Create visibility states.

2. Set Text to show all objects.

3. Set Zero to show all objects except the attribute.

4. Remove grip from visibility

5. Create a "Block property tablet".

6. Add the stretch parameter to the tablet

7. Open excel, create a table ranging from 0 - *your maximum value* (based on the object your stretching)

8. Copy the table and insert it into block property table.

9. Add visibility to blockproperty tablet and set all values to equal Visibility state "Text" except the value 0 which your set to equal "Zero".

10. Set the BPT to "Values must match Block property tablet"

 

Now everytime your stretch parameter hits "0" the visibility should change to "Zero" not showing your attribute.

 

This will make your block heavier and also slower working with. But it works..

 

Hope it helped.

Attached is an example of the method.

 

 

 

 

Signature, sincerely... //Adam
AutoCad LT 2016
Give Kudos where credit is due, Mark "accepted as solution" if the post solved your question.
Message 5 of 5
Nirand
in reply to: AcadAdamLT

This is a good solution and I thought in that direction but unfortunately I use visibility. It's frustrating that I can't solve it with field and simple if function.

Thank for that Alternative.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services