Dimension style doesn't correspond to its properties

Hello

I want to apply user dimension style to every new dimension I've created. I recived a custom ObjectId dimension style and set it to DimensionStyle property of dimension inside using, BUT when I run the program result is confusing… Style is applied, but properties are completely different (pic 1). if I manually select any other dimension style in UI and select user defined style again everything becomes fine (pic 2).

How is that?

Comments

  • Hello.

    It might be that some dimension entities have overrides applied.

    You could experiment with using the _DIMOVERRIDE command with the option _Clear, and select the dimension entities from which the overrides should be removed.

    After this operation, the selected dimensions will use all the settings of the dimension style assigned to them.

  • Evgeniy
    edited 10:14AM

    Hello Virgil,

    Thank you for your advice, it works, but manually. Is there any .NET method to implement this?

  • Hello.

    I couldn't find a specific .NET function to do the task.

    The solution seems to be more complex, depending on the full requirements of the project.

    The post linked below could be a start point for finding this solution.
    The post is related to Autocad but the overall approach should be similar.

    https://forums.autodesk.com/t5/net-forum/remove-dimstyle-overrides-using-c-sharp/td-p/7692614

  • Thanks for advice. What do you think is there way to use doc.SendStringToExecute() for that case? I've tried, but stuck in part of selection of particular element. Google tells me to use element handle but still o luck.

  • If you assign dimension style by using the Matchprop command instead of the Properties panel you don't have to worry about any overrides the target entities had. You'll be matching not only the dimension style but also any overrides the source entity has.

    I use a custom QD command, which selects all the dimension entities in a drawing, and then a custom version of the Matchprop command, which allows pre-selection of a set of target entities and then selection of the source entity after the command is executed.