How to change the display style of reference presentation? I found mdlRefFile_setIntegerParameters in C++ and Bentley.Interop.MicrostationDgn.Attachment.Presentation in C#, but both of them can not change the display style into a customized style.
Redrum Tan said:How to change the display style of reference presentation?
Which version (e.g. v10.x.y.z) of MicroStation CONNECT are you using?
Redrum Tan said:I found mdlRefFile_setIntegerParameters in C++
Prefer to use the C++ class DgnAttachment to the MDL functions. However, I don't see anything concerning display style in that class. Perhaps Robert Hook can help?
DgnAttachment
Regards, Jon Summers LA Solutions
I'm using 10.08.01.33 OpenRoads Designer CONNECT.
Hi Redrum,
I agree with Jon it's probably not possible. I think even to obtain the display style, defined in Presentation dialog, is not straightforward.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Well, I think I need to find another way.
Thanks anyway.
Redrum Tan said:I think I need to find another way
A possible route, but not guaranteed to provide success, is to record a VBA macro. Sometimes the macro recording will reveal the application variable that was changed when you modify a UI widget.
I tried to record a VBA macro, but found nothing useful. Thanks anyway.
I notice that the reference is created from a named view, so I modify display style of the named view and set reference SynchWithNamedView value to "NamedViewPresentation".And it's worked.
Redrum Tan said:I notice that the reference is created from a named view, so I modify display style of the named view and set reference SynchWithNamedView value to "NamedViewPresentation"
Thanks for letting us know your solution!
I see that from a named view you can obtain both ViewInfo and ViewPort. ViewInfo::GetDisplayStyleCP() gets a const pointer to the display style for a view. I don't see a way to set a view's display style programmatically.
ViewInfo
ViewPort
ViewInfo::GetDisplayStyleCP()
const
The code to set display style of ViewInfo is following:
ViewInfoR vInfo = namedV->GetViewInfoR(); //setter of ViewInfo... //... DynamicViewSettingsR settings = vInfo.GetDynamicViewSettingsR(); //setter of DynamicViewSettings //... int styleIndex = DisplayStyleManager::GetIndexForDisplayStyle(displayStyleName, ISessionMgr::GetMasterDgnFile()); settings.SetDisplayStyleIndex(styleIndex); namedV->SetViewInfo(vInfo);