[ORD 2019 R3] Survey Point Rotating to Linear Segments via SmartObjects VBA - Inconsistent Results

We are using a customized version of the SmartObjects VBA Project and it is working as expected for some features but not others. The tool cannot rotate cells upon initial import as the lines are not created until all the points are displayed. So the project requires a manual redraw of the survey fieldbook before the cells will rotate. 

We are using it for two types of cells. The ones that work are pavement marking symbols, like turn arrows and word appliques (ONLY, LEFT, SCHOOL, etc.). The only caveat is that sometimes the direction of the nearby lines (road striping) results in the symbol being out by 180 degrees. The ones that are not working are our Guy Wire Anchor Cells. These are usually draw using a JPT code, unlike the road striping. Since that seems to be the only difference between the two, I wonder if the rotate code just cannot work on JPT lines. Of if the fact that the segment shares a coincident point with the cell is the problem.

I welcome any suggestions.

BYW, this is a sort of update to an older thread, but it is a newer version and more information. If anyone has managed to get a Guy Anchor cell to rotate, I would love to find out how.

  • Talking to myself again...

    With further testing, I have determined that the Rotate cell code apparently cannot handle the fact that the cell requiring rotation shares one point on the figure that it is supposed to rotate too. This is true with the delivered SmartObjects Rotate Cell Code and our locally customized version. As it tries to find the nearest projection point, it eventually finds the smallest projected distance point but when projected onto the line, they are the same point. So the angle to align is zero.

    The code needs to determine the nearest segment and read its start and end and use that as the angle. Ideally, the code should be able to test is the point is one of the points on the nearest figure and then use that information to calculate the angle.

    Where do I get help on fixing this? I have VBA Coding experience, but my skills are very rusty. And it seems to me this supplied code is defective.


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
  • Chuck,

    Please keep us posted in this thread about cell rotation automation. 

    Take care,

    Cliff

  • I revisited our code. It seemed like the easiest solution was to make two different cell rotation macros. The delivered version is great for aligning to nearby linear elements. The new one I created is expressly for aligning cells with a linear element that shares a common point.

    Once I've cleaned it up I will see about sharing it. It will end up in our CAD Standards. but the web versions are always behind the PW Managed Workspace and internal versions.


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996
  • Hi Chuck,

    I'm currently wrestling with these different scenarios. Rotating pavement markings, guy wire cells, signs, light fixtures, gate posts, etc. It looks like we were able to rotate some cells to linear elements in the file by modifying the SmartObjects macro. Would you be up to sharing the code that you have created? Maybe we could massage it to work with our cells. I do have some code that allows the rotation of a cell to another cell and it works fine as long as there are not other same named cells within the search area, it gets confused and is not reliable. Bentley removed the JNC code that allowed us to join one point to another and this would rotate a cell in the file to its mate cell. I know this may sound rather confusing to others who have not tried to resolve these issues but figured you might understand since you have a lot of history with this.

  • Here is the ORD version of Smart Objects. It still contains all of the regular modules. Our code is all found in the SHA0201 module. They are documented in a manner very similar to the delivered code, with examples in the initial comments. The regular modules may not be the most recent Bentley versions. Since we were using our own code, we never worried about updating their code.

    Key Features: We pass Element Templates to the procedure for it to use for any graphics it creates. WE have a lot of label tools. We created these before Survey had its own labeling capabilities. While we have stopped using some of these labels, others include error checking that is unavailable using the survey labels.

    We hope to be making our ORD Workspace available soon, but we still have a lot of work to do and do not want to stop those efforts while assembling all the things we need to publish that workspace. However, our V8i Workspace does have the Open Roads Survey DGNLIB's and a version of this VBA Project. So there are files that can be reviewed with our Alpha Code list, attributes, etc. which are all part of t his process.

    /cfs-file/__key/communityserver-discussions-components-files/5922/SmartObjectsSHA.mvba


    Charles (Chuck) Rheault
    CADD Manager

    MDOT State Highway Administration

    • MicroStation user since IGDS, InRoads user since TDP.
    • AutoCAD, Land Desktop and Civil 3D, off and on since 1996