Is it possible to create wall programmatically with C# while creating wall manually in editor?

Is it possible to create wall programmatically with C# while creating wall manually in editor?

simongido1
Explorer Explorer
735 Views
3 Replies
Message 1 of 4

Is it possible to create wall programmatically with C# while creating wall manually in editor?

simongido1
Explorer
Explorer

Hello, I am trying to create walls programmatically using C#. I tried using both custom IExternalEventHandler and UIControlledApplication Idling handler. Unfortunately, Idling nor custom event is executed when I am not editing my walls using the editor. This is the code I use to create walls. It works correctly when I am not modifying walls.

 

transaction.Start("create wall");

Wall wall = Wall.Create(document, line, levelId, false);
App.ThisApp.World.SetEntityElementID(wallData.Entity, wall.Id);

transaction.Commit();

 

 

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

RPTHOMAS108
Mentor
Mentor

Should implement IUpdater to respond to changes in the document with further changes.

0 Likes
Message 3 of 4

simongido1
Explorer
Explorer

I tought updater will respond only if I finish wall, the problem is, my walls come from external source over internet

0 Likes
Message 4 of 4

ricaun
Advisor
Advisor
Accepted solution

Your question is a little confusing, and I guess you want to execute some code when you are inside the Revit Wall command when you are on the state to draw some walls.

 

If that's the case probably the Idling and IExternalEventHandler never gonna fires.

 

Idling only fires when Revit is not busy, when you execute some command Revit stops firing Idling until the command ends.

 

IExternalEventHandler is similar, gonna fire when an Idling event happens.

 

IUpdater is possible to trigger some code when you create a Wall.

 

See yaa!

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes