Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C3D Expression - Multiple Dimensions

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
gsiebs629
663 Views, 8 Replies

C3D Expression - Multiple Dimensions

I would like to create an expression that returns the inner pipe diameter if the pipe is circular, and the inner height and width dimensions if the pipe section is square or elliptical.  I tried this in the expression editor:

 

{Inner Pipe Diameter}|{Inner Pipe Height}&{Inner Pipe Width}

 

but it returned ??? in the label

 

Thoughts

8 REPLIES 8
Message 2 of 9
sboon
in reply to: gsiebs629

An expression can only return one value, so asking for a height and width is probably not going to work.

 

Steve
Please use the Accept as Solution or Kudo buttons when appropriate

Steve
Expert Elite Alumnus
Message 3 of 9
gsiebs629
in reply to: sboon

Hmmm...The file I am using already has a working "properties" function that can be added to labels or tables called "Inner Pipe Diameter or Width", that inserts <[Pipe Inner Diameter or Wdith(Uin|PO|RN|AP|GC|UN|Sn|OF)]> into the field and seems to return the appropriate dimensions.  I want to accomplish the same thing, but I want to list height and width instead of just width.

 

Is this an example of an expression, or is it something different (a "property"?)

 

Greg

 

 

Message 4 of 9
sboon
in reply to: gsiebs629

If you right click on a pipe and open up its properties dialog you can see all of the data which can be used to build the label components.  Most of the parameters are identical for all pipes, but down near the bottom is the Cross Sectional Shape.  If you compare a Circular pipe with other shapes it appears that the same field is being used for both Diameter and Width, while the Height value is only available for non-circular pipes.

 

I assume that the labeling property you're using simply applies this value, without consideration of the cross sectional shape, so you get a number but don't know which one it is.  I was going to suggest that you build an expression to check the shape and make a decision which could be used to build a label that would work but apparently the shape parameter is not available for expressions.

 

Anybody else have a solution here?

 

Steve
Please use the Accept as Solution or Kudo buttons when appropriate

Steve
Expert Elite Alumnus
Message 5 of 9
troma
in reply to: sboon

When I look at the expressions in 2011 I see three properties available:

{Inner Pipe Diameter}

{Inner Pipe Height}

{Inner Pipe Width}

 

What do these return in different circumstances?  When the pipe is circular, do all three give the same value?  Or does only {Inner Pipe Diameter} have a value, and the other two are zero?

You need to figure out the answer to that question.

 

Whatever the case, you should be able to set up two text componants in your label: one that looks right for circular pipe, and one that works for eliptical pipe.

Then, create an expression that returns a zero value in one case, and returns your text height in the other.  Create another expression that does the same test and returns the opposite vaules.  Now use these expressions to set the text height of the two componants in the label.

 

So you end up with the circular pipe text componant displaying nicely for circular pipe, but disapearing (zero value text height) when the pipe is eliptical; and vice versa with the other text componant.


Mark Green

Working on Civil 3D in Canada

Message 6 of 9
gsiebs629
in reply to: troma

The diameter property contains information if the pipe is circular, and the width/heigh properties contain information if the pipe is elliptical or rectangular.  I can create labels that look correct for both, but am not sure how to create an expression that updates text size according to the information.


I want this information to appear in a table, and can always just use one column for diameter or width (with the existing expression that works) and then add one for height in the case that it exists.  However, when there is not information in this property for a pipe, the calculation returns "???".  Is there a way to make this "-" or even just blank?


Greg

Message 7 of 9
sboon
in reply to: gsiebs629

OK - I think I've got it.

 

Both of these labels share the same style.  One is showing an 18" round pipe and the other is for a 24x24" box culvert.  I created an expression called HeightCheck which outputs the value 0.01 if the Inner Pipe Height is <> 0

Clipboard01.png

 

My label style has two text components.  Note that the HeightCheck value is being used for the Text Height here.  If the value for the Inner Pipe Height exists then this component will display in the label, otherwise not.

 

Clipboard02.png

 

There's actually another solution which may be useful also.  There is a label parameter called Part Size Name which produces a piece of text that includes dimensions, material and part type all at once.  When I tried it on one of my examples I got "24 x 24 inch Concrete Box Culvert" The only problem with this is you don't have any control over the format of it.

 

Steve
Please use the Accept as Solution or Kudo buttons when appropriate

 

 

Steve
Expert Elite Alumnus
Message 8 of 9
andrewpuller3811
in reply to: sboon

Very well done.

 

You could also apply the same expression to the Height and Diameter components.

 

You could have a label component with - Width {Inner Pipe Width} and set the text height using the same expression you are using for the pipe height component, and another with - Diameter {Inner Pipe Diameter} and set the text height based on an expression which returns the opposite values to the other expression.

 

 if({Inner Pipe Height}!=0,0,0.01)

 

 



If a post provides a fix for your issue, click on "Accept as Solution" to help other users find solutions to problems they might have that are similar to yours.

Andrew Puller
Maitland, NSW, Australia
Windows 10 Enterprise 64bit
Intel core i7 11800 @ 2.30 GHz with 32GB Ram
Civil 3d 2021
Message 9 of 9

Thanks for the help!

 

This works for label styles...any way to make it work in a table as well?


Greg

 

 

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report