Connector Orientation

I am still looking through all the interesting cases my colleagues dealt with during my absence.
Here is another one handled by Joe Ye on the width and height orientation of a Revit MEP connector:

Question: Given an Autodesk.Revit.DB.Connector object, is it possible to know where the height and width dimensions are relative to the Connector.CoordinateSystem?
The width and height directions do seem to be aligned to either the coordinate system X or Y axis, but not consistently one way or the other.
I need a way of knowing which axis of the coordinate system the width and height align with.

Answer: The width is relative to the x axis and the height is relative to the y axis of the coordinate system of the connector. There is a difference between the width and height of the connector and the width and height that is exposed in the user interface options bar.
The UI is based upon the orientation of the element in the current view.
The normal of the MEP element’s underlying curve object and the family instance Z axis is used to determine this.
Extra checks need to be made for fittings based upon the z axis of the family, because they can be oriented not only relative to plan.
Typically, if the family’s z axis is 0,0,1, you can assume the width and height is correct.
If it is not, the width and height need to be swapped when the rotation is greater than 45 degrees from vertical.
The connector is bound to the face of the family, so it does not rotate independently.

Many thanks to Harry Mattison and Joe for this explanation!


Comments

2 responses to “Connector Orientation”

  1. Hi Jeremy,
    i will try to look into the line thing, if i know more i just write you a coment again.
    but now i just have 1 more little thing that i was trying to do.
    most of the time when we sent out drawings for construction and/or approval, we Plot the sheet, and after that we make an export of the drawing to dwg. this is done for correct achivement of our drawings, plus during construction the DWG sit still asked for.
    now i was wondering, could this be done trough a simple add-in button, after all these are all functions that already exist, but will be much more easy to do trough 1 button.
    Also, in Autocad we have a LSP routine for this, making the drawing make a copy of himself to some certain spot on the harddisc, puting a certain text spamp on it,making pdf, and so on.
    could such a lsp for autocad even be “connected” to the exported dwg from revit ? so this all is done with just 1 simple click on the add-in toolbar in revit ?
    Best Regards,
    Dante

  2. Dear Dante,
    If all of this can be achieved by simple mouse clicks, then you should be able to automate it as well.
    The easiest way to automate things is if they are accessible through the API.
    If not, you can also try to simulate user input through Windows messages or other utilities, cf.
    http://thebuildingcoder.typepad.com/blog/2009/05/vb-samples-and-other-questions.html#1
    If you have an AutoCAD utility that does part of the task for you, then you can probably drive AutoCAD and plug-ins loaded into it from a Revit add-in, cf.
    http://thebuildingcoder.typepad.com/blog/2008/11/running-autocad-inside-revit.html
    Cheers, Jeremy.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading