Hi
OpenRoads Designer 10.08.01.33
I am looking to export (backup), and ultimately import, my corridor objects (key stations, point controls etc).
My question:- is there a way to "Lock - deactivate rules" via the SDK while importing, and then "unlock -reactivate rules" once the import is done
I have searched through the ORD SDK, and found nothing
I tried recording via VBA but nothing gets recorded
Thanks
Mark
Mark Gardiner did you ever make any progress?
Regards
Chris
AECOM Roads UK&I Digital Engineering, Design & Solutions Lead | Sector Information Management Lead
Associate Director – Digital
OpenRoads Designer 10.12 | MicroStation 2023 | ProjectWise CE 10.3.4 | ContextCapture | ProjectWise PowerShell 2023 | ProjectWise WSG API | Generative Components | OpenBridge Designer 10.12
Civil 3D 2023 | Dynamo | Navisworks Manage
PowerShell | Visual Studio | Office 365 | Power Platform | Teams | SharePoint | Visio
Speckle | BIMVision | Revizto | Solibri
No,
In fact as of 2022 R1, I can no longer read the start and end station of a point control as this has been removed from the SDK
Mark Gardiner said:In fact as of 2022 R1, I can no longer read the start and end station of a point control as this has been removed from the SDK
Just for curiosity, because I have not used point control in my code (yet): What class represents it and what method/property was removed?
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
IEnumerable<IRule> pointControlRules = Bentley.CifNET.Objects.RuleManagement.RuleManager.GetRulesAffectingObject(pointControl.DomainObject); var pointControlRule = pointControlRules.FirstOrDefault() as PointControlRule; if (pointControl.ControlType == Bentley.CifNET.GeometryModel.SDK.PointControlType.Alignment || pointControl.ControlType == Bentley.CifNET.GeometryModel.SDK.PointControlType.Alignment3d) { //pc.ControlName = GetAlignment(pointControl.PlanAlignment); if (pointControlRule.ReferencePlanEntity != null) { pc.PlanReferenceName = pointControlRule.ReferencePlanEntity.Name; } if (pointControlRule.ReferenceProfileEntity != null) { pc.ProfileReferenceName = pointControlRule.ReferenceProfileEntity.Name; } pc.StartStation = pointControlRule.TargetBaseCorridorElement.StartStation; pc.EndStation = pointControlRule.TargetBaseCorridorElement.StopStation;
This should help you find start and end stations.
This seems to be working for me:
public static void SetCorridorActive(Bentley.CifNET.GeometryModel.SDK.Corridor element) { IEnumerable<IRule> rules = Bentley.CifNET.Objects.RuleManagement.RuleManager.GetRulesAffectingObject(element.DomainObject); var corridorrule = rules.FirstOrDefault() as CorridorRule; corridorrule.RuleState = RuleState.Activate; } public static void SetCorridor2Locked(Bentley.CifNET.GeometryModel.SDK.Corridor element) { IEnumerable<IRule> rules = Bentley.CifNET.Objects.RuleManagement.RuleManager.GetRulesAffectingObject(element.DomainObject); var corridorrule = rules.FirstOrDefault() as BaseCorridorRule; corridorrule.RuleState = RuleState.Deactivate; }