Hello,
I'm trying to write something in VBA that calculates slope based on two elevation points and a distance. All the information is given. I just want to click on the two elevation text values and then the dimension value to produce a percent value in text that I can place on the sheet. Can the value of a dimension be pulled into a variable?
Thanks in advance for your help.
Hi,
without testing, I guess ActualValue property of DimensionElement contains the dimension length.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Why not, just take the origin point of your text to get your x, y and then the text contains the elevation. It is just math after that.
LARRY WILSON | Senior Designer Crawford, Murphy & Tilly | Engineers & Consultants 84 Remick Blvd. | Springboro, OH 45066 lwilson@cmtengr.com
Thank you for your response Larry,
The information on the sheet is not to scale. But its all math. Everything is given. All I want to do is click on the highest elevation text then the lowest elevation text and divide by length by clicking on the given dimension (thats not to scale). Three clicks and then a slope is given and hanging on my cursor for me to place.
If the dimension is not to scale, I assuming that the text has been changed. Just read the dimension and read the text.
I agree with Larry, to identify the texts only and to use their coordinates should be enough and in my opinion it's more robust and safe approach, because texts can be wrong or the dimension value can be overwritten. It's not important whether the texts are in model referenced in scale to 2d sheet. I am quite sure, but I have no such code in my pockets now, that VBA can get or calculate (because the attachment transformation is known) original values.
I also agree that to use texts and dimension value will probably lead to simpler code.
Regards,