Structure Style Name in Table Expression

Structure Style Name in Table Expression

Anonymous
Not applicable
588 Views
3 Replies
Message 1 of 4

Structure Style Name in Table Expression

Anonymous
Not applicable

I need to create a structure table that fills in the vertical height for structures (rows) in columns that correspond to the structures' style (replace, rehab, install, etc).

I know that <[Style Name]> works in structure lables and table, but it does not seem to work in the expression editor.  As it is, I create a structure table with the structure name, Rim to Sump Height, and <[Style Name]>; then export to Excel where an IF() statement moves the heights to the appropriate columns; then back to C3D with a buch of dumb text in tow. I would like to have a structure style based IF() statement in the structure expressions to keep everything in a dynamic in Autocad.

 

This is my end product:

Structure Table (Lines and Text).JPG 

 

Any help would be greatly appreciated

0 Likes
589 Views
3 Replies
Replies (3)
Message 2 of 4

Civil3DReminders_com
Mentor
Mentor

I don't think that is possible to use a string in the expression. 

 

You can use another structure property to do what you want. I'd maybe use something like this:

 

Existing:

IF({Known Capacity}=1,{Slab Thickness},-1) 

Proposed:

IF({Known Capacity}=2,{Slab Thickness},-1) 

Fred:

IF({Known Capacity}=3,{Slab Thickness},-1) 

 

You can also add custom properties to a structure and then use those for the check:

http://beingcivil.typepad.com/my_weblog/2010/07/assigning-optional-properties-to-a-part-size.html

http://blog.civil3dreminders.com/2009/04/pipe-network-custom-parameters.html

Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
0 Likes
Message 3 of 4

Anonymous
Not applicable

I assume that I would have to update the additional property to correspond with the type of work being done. Or is it possible to have a structure property change based on its current style?  I love the ability to change a structure's apearance by changing its style, and how the lables update automatically. It would be great if that functionality could work in an expression. Basically, if the structure looks right then it is labeled right and all the tables are right.  Perhaps I am lazy, or prone to skipping steps.

 

 

0 Likes
Message 4 of 4

Civil3DReminders_com
Mentor
Mentor

If you wanted to you could code some stuff and have it work. For instance you could modify the pipe rules to have a check that would apply the appropriate value based on the style name. 

 

The source code for the pipe rules are located here: C:\Program Files\Autodesk\AutoCAD 2015\C3D\Sample\Civil 3D API\C3DPipeNetworkRules

 

And the code would look something like below. I'd put in ValidateRuleImplement part of the CoverAndSlope.vb file that way it would be run each time the pipe is selected. This code hasn't been tested and I think it may require a some additional code to work properly. The code could also be put in a command where you hit a button and then selected pipes and/or structures would be analyzed and then assign the appropriate value.

 

        Dim record As PartDataRecord = oPipe.PartData
        Dim PartDataFld As PartDataField = record.GetDataFieldBy("StructureTypeForTable")

        Dim valueToUse As Integer = 0

        Select Case oPipe.StyleName
            Case "Existing"
                valueToUse = 1
            Case "New"
                valueToUse = 2
            Case "Phase 1"
                valueToUse = 3
        End Select

        If PartDataFld.Value <> valueToUse Then
            oPipe.UpgradeOpen()
            PartDataFld.Value = valueToUse
            oPipe.PartData = record
            oPipe.DowngradeOpen()
        End If
Civil Reminders
http://blog.civil3dreminders.com/
http://www.CivilReminders.com/
Alumni
0 Likes