Anchor Section Lines To Objects

Anchor Section Lines To Objects

Hugh_Compton
Advisor Advisor
810 Views
3 Replies
Message 1 of 4

Anchor Section Lines To Objects

Hugh_Compton
Advisor
Advisor

Is it possible to 'Anchor' section lines to elements so that when the elements are moved / rotated within a project RVT their sections remain correct?

 

Thanks

0 Likes
Accepted solutions (1)
811 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution
Check your SDK for a sample under
Revit 2016\Samples\DynamicModelUpdate\ called "SectionUpdater.cs" This is an excellent example of how to achieve what you'd like to achieve.

It's not directly applicable but can certainly be modified to create a nice associative section tool
Message 3 of 4

Hugh_Compton
Advisor
Advisor

 

Hello

 

The sample does work nicely in a session of Revit.  The problem I get is that when I close and reopen Revit it loses the Section / Window associations. 

 

How can I get the sample to register with Revit on startup? I have tried a hack as shown below:

 

 public Result OnStartup(UIControlledApplication a)
        {
            m_sectionUpdater = new SectionUpdater(m_thisAppId);
            m_sectionUpdater.Register(m_document);

            // Register the updater in the singleton 
            // UpdateRegistry class
            UpdaterRegistry.RegisterUpdater(m_sectionUpdater);

            // Set the filter; in this case we 
            // shall work with beams specifically
            ElementCategoryFilter filter
            = new ElementCategoryFilter(
             BuiltInCategory.OST_Windows);
            
            // Add trigger BENS NOTE, I AM NOT SURE HOW TO GET THIS TO WORK - OR IF IT IS NECESSARY!
           UpdaterRegistry.AddTrigger(
              m_sectionUpdater.GetUpdaterId(), filter,
             Element.GetChangeTypeGeometry());
         //   m_sectionUpdater.AddTriggerForUpdater(m_document, idsToWatch, sectionId, sectionElement);

            return Result.Succeeded;
        }
0 Likes
Message 4 of 4

Hugh_Compton
Advisor
Advisor

Loading_Error_Message.JPG

 

Above is  the error message that I receive.  Revit doesn't remember which section lines are anchored to which windows...

0 Likes