Hello guys!
After a long time of silence I came up with another question. I remember i had question similar to this behavior, but that was for V8I version.
Lets say i have a complex chain consisting of multiple lines. Now i want to modify linestyle for these lines (some lines will have different linestyle). I can do it from the code, I even see the linestyle in the Element information tab but the entire complex chain doesn't change anything. I can see all lines having the same old linestyle even after the change. The funny thing is, when I open the given DGN in old V8i SS10, it is displayed correctly.
I just installed newest Update 16 Opencities Map Advanced (10.16.02.014), but the problem still persists. Is there something I miss? I also tried to create complex chain manually(not from code, using the tool Create complex chain). I had 4 lines, 1 with changed linestyle. After converting the lines to complex chain, the linestyle vanishes and is set up to the default one(the parent complex chain one).
I can provide more info(like code example etc.), but to be honest I didn't know what to start with, so it can be added. Thanks guys
Hi Lubo,
Lubo B said:Now i want to modify linestyle for these lines (some lines will have different linestyle)
in my opinion you try something not allowed by MicroStation.
I think it was possible long time ago, but even in V8i, it's not possible to change individual elements in complex chain in Element information dialog. And when you try to do it in old Analyze element dialog, the whole element is changed.
I remember there was a discussion in the past (but have no time to try to find it now) when it was discussed CE platform goes even further in understanding complex elements as one element (it's visible in different places in APIs).
When you want to have more different elements grouped, use cell.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hello Jan! Thanks for your input. However I need complex chain/shape for its fill purpose. Isn't there really achieve a way with the approach I talked about? Like having a complex chain with each line having different linestyle? (Even when only from code)
Lubo B said:Even when only from code
My long term experience is that to try to hack and force MicroStation to do something that is not possible from GUI (or even allowed) is bad idea, because in long term perspective, it will return to you and kick you so much it will hurt.
This "let's do it in code" is old V7 / V8.0 approach (or mentality)), when low level access to data structures was possible using MDL and later C API, and MicroStation itself was very tolerant. With every major step, Bentley have introduced new rules, targeting more strict data structure. It's well visible in OOP C++ and NET API, where this low level hacking is typically not possible.
Lubo B said: Isn't there really achieve a way with the approach I talked about?
I do not recall any such option. At first, try to find whether there is any solution available at GUI and user tool level. When not, MicroStation probably does not allow it.
Also try to search this (and MicroStation user) forum, because complex elements were discussed several times.
Lubo B said:Like having a complex chain with each line having different linestyle?
My understanding is that now complex chain and shape are treated as one element, not as complex header with elements inside. So it's not expected individual elements have different attributes.
Jan Šlegr said:My understanding is that now complex chain and shape are treated as one element, not as complex header with elements inside. So it's not expected individual elements have different attributes.
What should I do then? If i need the properties of complex chain and also the possibility to have individual elements with different attributes.
Lubo B said:If i need the properties of complex chain and also the possibility to have individual elements with different attributes.
I think you want something that is not supported by MicroStation itself from (at least) V8i era. You can have complex element (which is one element with uniform symbology) or more independent elements (e.g. grouped in cell), but not both.
Lubo B said:What should I do then?
It's hard to say without knowing complete context. But I guess you must return back to original requirement and how it can be solved in MicroStation. Plus, to take in account you are not in MicroStation, but in OpenCitiesMap as far as I understand, which potentially adds own limitations and features.
Regards,
Jan Šlegr said:I think you want something that is not supported by MicroStation itself from (at least) V8i era. You can have complex element (which is one element with uniform symbology) or more independent elements (e.g. grouped in cell), but not both.
To be honest I'm surprised, didn't expect restrictions will appear in Connect versions. But can't be helped though.
Jan Šlegr said:It's hard to say without knowing complete context. But I guess you must return back to original requirement and how it can be solved in MicroStation. Plus, to take in account you are not in MicroStation, but in OpenCitiesMap as far as I understand, which potentially adds own limitations and features.
Basically I need to hide some lines of complex chain - to hide them I use special linestyle.This behavior works fine (even though maybe its not supported by editor, but by code it works..so yea i was kinda hoping it would work the same way in CONNECT). For example in Opencities I see the whole complex chain with same linestyle, If i open the same dgn in Microstation V8i some lines have applied the linestyle I used.
Lubo B said:To be honest I'm surprised, didn't expect restrictions will appear in Connect versions.
It was discussed many times (and visible in API too) that CE adds new requirements, sometimes because of targeting more consistent data, in other cases it just a consequence of internal changes.
And what we are discussing is (at least) not CE new feature, because it's something that cannot be achieve in V8i also, only direct hacking of DGN data (which cannot be treated as a standard way).
Lubo B said:This behavior works fine (even though maybe its not supported by editor, but by code it works
That something works using code does not mean it is the right solution. It's a big difference between old C API, allowing to hack data directly, whereas OOP C++ API hides technical details and provide only object abstraction, which does not allow low level modifications.
Lubo B said:For example in Opencities I see the whole complex chain with same linestyle, If i open the same dgn in Microstation V8i some lines have applied the linestyle I used.
Yes, because complex elements are processed in different way and in CE it is not expected child elements have different symbology.
Lubo B said:Basically I need to hide some lines of complex chain - to hide them I use special linestyle.
I guess somebody from Bentley (Robert Hook, Brien Bastings) may provide ideas how to solve such request..
Jan Šlegr said:Lubo B said:For example in Opencities I see the whole complex chain with same linestyle, If i open the same dgn in Microstation V8i some lines have applied the linestyle I used. Yes, because complex elements are processed in different way and in CE it is not expected child elements have different symbology.
Changes to level, color, weight, element class, and linestyle *** start/end width only *** on components is still supported for display in the current version. This was strictly done to support legacy data.
Jan Šlegr said:Lubo B said:Basically I need to hide some lines of complex chain - to hide them I use special linestyle. I guess somebody from Bentley (Robert Hook, Brien Bastings) may provide ideas how to solve such request..
You may be able to set the components to invisible (hdr.dhdr.props.b.invisible). Should be fine in current version, but you'll have to check older versions you care about for their behavior. The other historical mechanism for creating gaps in complex shapes/chains is by creating linestring components with disconnect points. Disconnects were a terrible idea (invalid double value), but it's an option if the invisible bit doesn't pan out as I don't recall a version that didn't support them.
Complex chains/shapes were intended to be a uniform symbology so that they can be treated as a continuous path or loop, but due to the nature of complex elements and coincidence of how older versions displayed these complex elements, applications were able to get away with things that were never intended or supported by the delivered creation/modification tools.
HTH
-B
Answer Verified By: Lubo B
Thanks a lot for the explanation and details!
Thanks!