Author Topic: C3D 2016 Label Expressions  (Read 109 times)

0 Members and 1 Guest are viewing this topic.

rugaroo

  • Bull Frog
  • Posts: 372
  • The Other CAD Guy
C3D 2016 Label Expressions
« on: October 02, 2017, 08:53:52 pm »
Ok, this one may be a quick answer for someone out there. I am creating C3D label expressions in VB .Net for C3D 2016, and creating the expressions is somewhat easy, BUT does anyone have any idea of how to insert one of my expression names into another expression?

If I use say:

Code: [Select]
Dim _ExpColl As ExpressionCollection
Dim _LblStyleColl As LabelStyleCollection
Dim _Expression As Expression = SomeExpression
_ExpColl = _LblStyleColl.Expressions
_ExpColl.Add("ThisExp", "This is an expression.", "1+" & _Expression.Name)

I end up getting an error saying the expression is invalid. Now if I use:

Code: [Select]
Dim _ExpColl As ExpressionCollection
Dim _LblStyleColl As LabelStyleCollection
Dim _Expression As Expression = SomeExpression
_ExpColl = _LblStyleColl.Expressions
_ExpColl.Add("ThisExp", "This is an expression.", "1+" & _Expression.ExpressionString)

The whole string comes in properly, but what a mess of text. Regardless, do any of you know how I would be able to get the expression name to come into my new expression so I don't have static info?

Thanks in advance.
LDD06-09 | C3D 04-15 | Infraworks 360 | VS2012

"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."

Jeff_M

  • King Gator
  • Posts: 3904
  • C3D user & customizer
Re: C3D 2016 Label Expressions
« Reply #1 on: October 03, 2017, 10:47:11 am »
First, you would need to enclose the Name in Curly Braces: "1+{" & _Expression.Name & "}" However, that doesn't work anyway. What C3D Displays as the expression when editing in C3D is just the Name, internally, the Name is preceded by some sort of identifier. Note how this value is returned for an expression using another as you are trying to do:       ExpressionString   "{General Segment End X}-{General Segment Start X}+{abaf6dbfdcd54d3056be879b91ae4849Delta Y}"
The actual name of the expression being used in this expression is "Delta Y". I have not yet found a way to determine what that identifier needs to be...

rugaroo

  • Bull Frog
  • Posts: 372
  • The Other CAD Guy
Re: C3D 2016 Label Expressions
« Reply #2 on: October 03, 2017, 11:30:44 pm »
Thanks Jeff, I did try using the curlies too, but I see what you are saying now that I am breaking it down a bit further, and listing all the properties. This also makes sense considering you can have hundreds of the same expressions... not sure why you would but yeah. I dug around a bit more with some of the info I could pull, but no luck so far... You think we might be able to get a response back via ADN?
LDD06-09 | C3D 04-15 | Infraworks 360 | VS2012

"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."

rugaroo

  • Bull Frog
  • Posts: 372
  • The Other CAD Guy
Re: C3D 2016 Label Expressions
« Reply #3 on: October 08, 2017, 11:32:01 pm »
Ok, so I have been playing around with this a decent amount over the last week and I really want to throw something. I tore down as much as I could without getting stuck in a rabbit hole, but still no luck. Please hear me out for a minute and see if any of this may possibly may some sense.

All of the built-in expressions do not have unique identifiers. These are hard coded and therefore never change. So thinking about it, are there any dictionaries in the C3D DB that may be housing the user created expressions? We can get the hashcodes for the custom expressions, but not sure if this is of much help, but I am assuming that there may be a way to cross reference the hashcode in order to find the unique identifier.

I almost think this is one of those needle in a haystack games, but we don't even know if there truly is a needle to find or if it is locked away somewhere. I did finally get C3D 2018 installed, so I may attempt to see if the same issue is present in the latest version or if they have made it more accessible, but doesn't help much considering I need it for 16.
LDD06-09 | C3D 04-15 | Infraworks 360 | VS2012

"Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something."