Hi folks,
Is there any way to add a named dimension style to an existing element that has no dimension style? The IDimensionEdit::ApplyDimensionStyle() function does not seem to be able to do this. After calling this function with a named dimension style and reading it straight back, the dimension has all of the settings of the applied dimension except the dimension style name. If the existing element already has a named dimension style then it works fine.
Basically I need to know how to do this programmatically, in any language: https://communities.bentley.com/products/microstation/w/microstation__wiki/18599/apply-dimension-style-to-existing-dimensions-which-have-no-dimension-style
I could achieve this in V8i with mdlDim_applyDimStyle() but this no longer works in Connect.
Cheers.
Hi Piers,
Piers Porter said: The IDimensionEdit::ApplyDimensionStyle() function does not seem to be able to do this.
This is the method that crossed my mind at first ;-)
I think I have not used it (yet), but from the description, it looks like to do what you need. What problem do you experience with the method?
regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Sorry if I didn't make my problem clear, but the function ApplyDimensionStyle() cannot add a dimension style name if one was not already set on the existing element. Querying the element with Element Information shows it still has Dimension Style (none), even though the dimension style I applied has a named dimension and a dimension style with this name already exists in the active model.
If the existing dimension does already have a named dimension style applied, then this function seems to work just fine and the new name is applied. So it seems there are some extra undocumented steps to attach a dimension style to an element that didn't have one set previously.
I think we sorely need some example code from Bentley showing how a dimension element with no dimension style can have a dimension style applied to it.
--Piers PorterAltiva Software
thanks for the explanation. Using C++ API documentation, I would not expect such behavior.
I agree further information from Bentley is required here.
Regards,