Hi! I have a bigger model with multiple levels and I’m trying to find a way to insert all vaPlanView’s and vaSectionView’s using python script. Alternatively to access the View/Level property of a vaPlanView.
I can’t find a suitable method in the API. What would be the best way to proceed? Is there a generic method that allows to edit any property of any object?
Hi @robertd it is not possible to create Plan and Section views with Python, but you can do it with Grasshopper components. Take a look at these two examples:
- Section views from GH: Create multiple 2D Section Views from Grasshopper - YouTube
- Plan views from GH: Automatic 2D Plan Views in Rhino with Grasshopper and VisualARQ - YouTube
@fsalla @enric we are looking for the same thing and cannot use GH for this. May you please add it to ‘VisualARQ.Script’. We are specifically requiring:
- GetActiveLevel(): Returning a tuple of (bulding name, active level name)
- SetActiveLevel(building_name: str, level_name: str): Setting the active level
- ToggleCutPlane(active: bool): True = Cut plane is on, false = cut plane is off
- GetActiveSection(): Returns the a currently active section (the one toggled with the check mark)
- SetActiveSection(section_name: str): Activates the specified section.
Those methods are essential for us to continue working with VA. With larger models an active VA section or VA cut plane on a detail view causes unacceptable slow downs. This multiplied by around 20 layouts results in an unusable file. To be able to continue working, we keep all detail views on all layouts in wireframe mode and all sections/level clipping off. Only for printing we switch on the necessary settings. With more layouts this becomes too tedious and we wanted to make a batch print function for which we need the above. (GH is not an option, only Python or .NET!)
Thanks
Hi @silvano,
I’ll implement those funcions in VisualARQ 2.13, but they will not have the same name and declaration, as they will work mostly with ids
instead of names
. I’ll send you a WIP build as soon as I have them implemented.
Regards,
Enric
Hi @enric,
This is outstanding support. Many thanks for implementing those methods. No worries regarding different method names or signatures. I am looking forward to the WIP. These methods will help a lot with speeding up our print script.
On a side note: The root cause of why we need those methods is very sluggish performance as soon as one of the following is true:
- Using VA’s “Hidden” display conduit
- VA section activated
- VA level clipping activated
The slowdowns of 2. and 3. are unrelated to geometry actually being cut. It feels like some callback gets registered by the above and causes the slowdown.
I can send you a screencast, if the above is unclear.
Thanks, Silvan
Hi @silvano,
During the week I’ve already implemented all building and level related methods in the API. I’m now working on section methods. Here are the new methods (in C# notation):
// Building methods
bool IsBuilding (Guid id);
Guid FindBuilding (String name);
Guid AddBuilding (String name, double elevation);
bool DeleteBuilding (Guid buildingId);
double GetBuildingElevation (Guid buildingId);
bool SetBuildingElevation (Guid buildingId, double elevation);
String GetBuildingName (Guid buildingId);
bool SetBuildingName (Guid buildingId, String name);
Guid[] GetBuildingLevelIds (Guid buildingId);
Guid[] GetAllBuildingIds ();
// Level methods
bool IsLevel (Guid id);
Guid FindLevel (Guid buildingId, String name);
Guid AddLevel (Guid buildingId, String name, double elevation);
bool DeleteLevel (Guid levelId);
double GetLevelElevation (Guid levelId);
bool SetLevelElevation (Guid levelId, double elevation);
double GetLevelCutElevation (Guid levelId);
bool SetLevelCutElevation (Guid levelId, double elevation);
double GetLevelTopOffset (Guid levelId);
bool SetLevelTopOffset (Guid levelId, double offset);
double GetLevelBottomOffset (Guid levelId);
bool SetLevelBottomOffset (Guid levelId, double offset);
String GetLevelName (Guid levelId);
bool SetLevelName (Guid levelId, String name);
Guid GetAboveLevelId (Guid levelId);
Guid GetBelowLevelId (Guid levelId);
double GetDistanceToLevelAbove (Guid levelId);
double GetDistanceToLevelBelow (Guid levelId);
double GetLevelHeight (Guid levelId);
Guid GetLevelBuidlingId (Guid levelId);
bool GetLevelVisibility (Guid levelId, Guid viewportId);
bool SetLevelVisibility (Guid levelId, Guid viewportId, bool visibility);
Guid[] GetVisibleLevels (Guid viewportId);
Guid[] GetHiddenLevels (Guid viewportId);
bool IsPlanModeEnabled (Guid viewportId);
bool EnablePlanMode (Guid viewportId, bool enable);
I will send you a WIP installer early next week.
The slowdown is caused by our plugin registering a display-conduit into Rhino display pipeline. A conduit allows third-party plug-ins to inject code into the display, required for hidden display or to make sections work, but these conduits have a penalty, as Rhino stops doing some optimizations.
Anyway, we have made impressive performance improvements in VisualARQ 2.13, especially related to sections and hidden display mode.
Can you send me the model you’re working on so I can test if these improvements work fine on your case? You can send it to visualarq@asuni.com
Thanks,
Enric
Hi @enric, I made a quick C# dummy display conduit in a test plugin and it seems to run without a speed penalty in this and other projects. I would be happy if you could use our project to test the improvements you made. Since this project is consisting of about 20 worksession files, I will need a moment to put everything in one file. I will be in touch next week via email.