Today I had a project where I needed to designate fill labels and cut labels with different colors and signs (+/-) to add to a volume surface. From what I recall from AU classes and have read online, there isn't a real easy way to do this, so I began doing a little research and found the following link. This page is good and works pretty well, except if you have to put a (+) sign in front of the positive numbers. In doing this you will find that the red cut numbers show up underneath the positive numbers - I thought there has to be a better way.
This began my venture into trying to utilize expressions to perform this same calculation. I created two expressions that check to see if the surface elevation is a positive number, or a negative number. Basically if the findings return a true value, then give me the Surface Elevation, and if it's false give me 0. (Note that expressions are only used for math equations and do not functions with strings). Here is an example of one of these expressions:
Next, since the above expression returns either the surface elevation or 0, I setup my spot elevation label to have a cut component and a fill component. Each component has different colors and references different expressions in the contents field. The image below is an example of the cut component referencing a the above expression within the contents - the difference between this and the link above is that the sign can remain set to a positive or negative based on what the number is. Upon setting both components up, you will see both components over top of one another - this needs to be adjust to make one "not show up" - and I quote this because you have to sort of trick the software into doing this.
Both components also reference a text size expression. The text size expression idea came from an Autodesk University class called "Exploit Expressions to Enhance Your Labels" by Brian Hailey and can be found here. His idea was to basically make the text you don't want to see really small so it does not plot, since there is no way to completely turn these off. I suppose you could take it a step further and change it's position to locate the text somewhere off in lala land as well. Anyways, I setup a separate expression to perform this task and can be seen in the image below. The results of the label style are shown at the bottom - enjoy!!
"Off in Lala Land", interesting concept that I had never considered. I might have to play around with that a bit. Only issue I can see is it would mess up your Zoom Extents command but if you are using saved views, not a big deal.
ReplyDeleteYea, as I was following your AU document I thought of that. Was thinking the same issue with Zoom extents so I did not attempt it. I think if Autodesk would add an option to the style component visibility to reference a number, then you could use an expression to show the labels or not show the labels - Like 1=True and 2=False. That would be best I think.
ReplyDelete