We have an MDL application (since ported to Native Code) that resymbolizes elements on the fly based on user specified criteria. Changing Color, Style, and Weight are the most common uses and this application has worked just fine for many years. I am in the process of modernizing it by adding support for Named Levels and Custom Linestyles.
The issue I'm having is trying to resymbolize lines\linestrings within attached reference files with a custom linestyle defined (actually in a RSC file) in the MASTERFILE (the custom linestyles have never been placed in these reference files). Even though I am adding the custom linestyle to the element descriptor (and validating it is there via mdlElement_hasLineStyle()), the custom linestyle refuses to display. The only way I can get the custom linestyle to display properly is to either copy the element into the MASTERFILE (in the code) or open the reference file as the main file and place a sample line with the target custom linestyle. These are not desirable as this application is meant only to resymbolize the display of the elements without altering the underlying dgn files.
I understand that this issue is likely caused by the reference file not having the custom linestyle definitions loaded - how can one accomplish this without physically touching each of the 1000+ dgn files that we use as reference files (they are provided by a third party).
All thoughts and commentary are greatly appreciated!
Thanks,
Jeff
Hi Jeff,
Unknown said:We have an MDL application
I recommend to read and follow MicroStation Programming forum best practices, especially rules about sharing mandatory information. From your post it's not clear even very important information if you are talking about some older MicroStation version, V8i or CONNECT Edition ... and if you are talking about MicroStation or some other product ;-)
Unknown said:I am in the process of modernizing it by adding support for Named Levels and Custom Linestyles.
It's a bit off-topic, but still related to development: Is such application, with respect to existing MicroStation resymbolization features, necessary? But I guess you need something more complex than straight simple resymbolization of elements created with "by level" attributes. In CONNECT Edition, Display Rules can be used also.
Unknown said:The issue I'm having is trying to resymbolize...
It's not clear how your code works, can you provide more details? Do you hook element display process (how?), stop it and provide own element instead of an original one?
Unknown said:I understand that this issue is likely caused by the reference file not having the custom linestyle definitions loaded
In my opinion there is nothing like "loaded by references": If a line style definition comes from RSC file, it's available for the whole session (active model and all attachments). Today the line styles can be also stored directly in a design file (if they were stored in dgnlib originally) and in such case I guess this definition is available for a specific reference only. But you mentioned you work with RSC.
Unknown said:All thoughts and commentary are greatly appreciated
Because I don't know how you code works, I can guess only: There are plenty of other settings related to reference attachments like reference presentation (view) attributes, attachment settings like scale etc. that influe how line style is displayed. If you place manually a target line style (element using this style) into the reference, is it displayed correctly?
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Jan/Jon,
Thanks for the responses, I should have been more clear originally, but here is more information. I'm having some difficulty with the quoting, so I hope this comes across formatted ok.
We are currently using MicroStation SS1 (8.11.07.171). Yes, time for an upgrade. :)
jeff.clough
jeff.clough The issue I'm having is trying to resymbolize...
Yes, precisely. Elements are intercepted before they are displayed, resymbolized, then displayed.
Public void updateV8i_init(void) { // Add update each element hook... mdlView_setSubstituteElemFunc (substituteElemCallback); }
Because I don't know how you code works, I can guess only: There are plenty of other settings related to reference attachments like reference presentation (view) attributes, attachment settings like scale etc. that influence how line style is displayed. If you place manually a target line style (element using this style) into the reference, is it displayed correctly?