Author Topic: DimStyleTableRecords  (Read 9631 times)

0 Members and 1 Guest are viewing this topic.

Glenn R

  • Guest
DimStyleTableRecords
« on: November 09, 2007, 11:31:18 PM »
Has anyone down anything with these beasties? I'm cloning one from a source dbase to the current dbase when needed, however it sometimes will appear with "Style Overrides" showing in the dim style manager.

I suspect it's occuring when the dim vars in the editor differ in any way from the newly cloned entry...the editor's values get applied as overrides....I think......

I've cloned/copyobjects in VBA I think, but it was a while ago...or was it creating a dimstyle....I seem to remember setting all the dimvars that I wanted, create the dimstyle and then use copyobjects on the dimstyle to get all the settings from the editor.....but I can't remember...maybe this will jog somebody else's memory.

There seems to little in the way of discourse or examples in the ARX docs, but I'll keep looking.

Cheers,
Glenn.

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #1 on: November 09, 2007, 11:34:59 PM »
For anybody who wants to play along, here is some test code:

LillyPondCode

Also attached is the "source" drawing. Build the dll and place the dwg in the same folder as the dll and then NETLOAD.

Cheers,
Glenn.
« Last Edit: November 11, 2007, 06:55:13 PM by Glenn R »

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #2 on: November 09, 2007, 11:36:09 PM »
Forgot to mention that the code and the dwg are for 2008.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: DimStyleTableRecords
« Reply #3 on: November 10, 2007, 12:31:56 AM »
Maybe it is showing style overrides because you haven't set the new style current?  Other examples are just copying over the styles, but if the style you are coping is current, and there are dim style overrides set already then I would think that it would keep the style overrides until you set the newly copied one current.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #4 on: November 10, 2007, 12:45:25 AM »
The style overrides are on my copy - there are no overrides on any other dim styles in the destination drawing and there are no overrides on my source dim style either...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: DimStyleTableRecords
« Reply #5 on: November 10, 2007, 06:09:02 PM »
I don't know what else it could be then.  If you set the new style current, are there still overrides?  I can test some stuff when I get to work on Monday, but you may solve the answer by then.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #6 on: November 10, 2007, 06:47:02 PM »
Thanks for looking Tim...I'll keep scratching away and see what I can come up with.

Quote from: AutoCAD ActiveX and VBA Reference
The active dimension style determines the appearance of new dimensions that are created in the drawing. To change the style of an existing dimension, use the StyleName property found on the dimension.

To control the settings of the current document overrides, use the dimensioning system variables. See "System Variables" in the AutoCAD Command Reference for a list of dimensioning system variables.

When you change a dimensioning system variable, you are actually setting a document override for the active dimension style; you are not changing the active dimension style itself. This means that all newly created dimensions will still be created with the active dimension style only and will not reflect the overrides from the system variables. The overrides from the system variables will not be recognized on new dimensions until the active dimension style is updated. To change the settings of any dimension style, use the CopyFrom method. This method copies a dimension style configuration, including overrides, from a document, dimension, or other dimension style.

Dimensions created via the AutoCAD user interface are created with the active dimension style plus all document overrides. Dimensions created via ActiveX are created with the active dimension style only. To have the dimensions created via ActiveX take on the document overrides, use the CopyFrom method to copy the dimension style from the document to the active dimension style. This process will copy all existing overrides into the active dimension style.

I just opened AutoCAD and in the default startup  drawing, I set the DIMSCALE = 10. I then looked at the Dimstyles in the Dim Style manager and sure enough, the current style had an override on it. I then set the DIMSCALE back to 1 and looked in the Dim Style Manager again and the override is gone.

Taking that behaviour with the quoted text above, I think I will have to check each dim style var against each document override and reset the document override to match the dim style var if they are different...I hope there is an easier way...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: DimStyleTableRecords
« Reply #7 on: November 10, 2007, 06:50:49 PM »
Taking that behaviour with the quoted text above, I think I will have to check each dim style var against each document override and reset the document override to match the dim style var if they are different...I hope there is an easier way...
You should just be able to set the dim style current, as the overrides will go away once you make that style current.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #8 on: November 10, 2007, 06:54:52 PM »
Tim,

What I just found was the opposite. The code I posted was NOT setting the newly cloned DIMSTYLE current at the end and if you run it in AutoCAD with the current dimstyle having overrides, then the clone comes in fine with no overrides.

If, however, you do the same process, but add setting the new clone current at the end of the code, then it takes all the overrides from the current dimstyle...the plt thickens...

Cheers,
Glenn.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DimStyleTableRecords
« Reply #9 on: November 10, 2007, 06:56:26 PM »
Glenn,
Can the dimstyle be saved after it is copied.

From Lisp I set variables then save the Dimstyle sucessfully ...not cloned though ..
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: DimStyleTableRecords
« Reply #10 on: November 10, 2007, 06:58:43 PM »
That sounds backwards.  I wonder if when you are setting it current if it is saving the overrides from some reason?  Sorry I can't test anything from home, as this has peaked my interests now.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #11 on: November 10, 2007, 07:00:06 PM »
Glenn,
Can the dimstyle be saved after it is copied.

From Lisp I set variables then save the Dimstyle sucessfully ...not cloned though ..

I'm not following you there Kerry, can you elaborate a bit please?
Do you mean you're setting all the document overrides, then using CopyFrom to copy those settings into your new style?

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #12 on: November 10, 2007, 07:02:57 PM »
That sounds backwards.  I wonder if when you are setting it current if it is saving the overrides from some reason?  Sorry I can't test anything from home, as this has peaked my interests now.

I know and it could be troublesome. Unfortunately, I must set the cloned DIMSTYLE active as this is kicked off from a CommandWillStart event and if a dimensioning command, I need to set a particular style current.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: DimStyleTableRecords
« Reply #13 on: November 10, 2007, 07:07:05 PM »

Not doing a copy from ..

simply

Restore a style
Setvars for the changes I want to make ( which creates overrides)
Save the Style with the new name.

I'm wondering if saving the Style after CopyFrom is required.

Are the overrides different to the copied Style ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Glenn R

  • Guest
Re: DimStyleTableRecords
« Reply #14 on: November 10, 2007, 07:08:34 PM »
Quote from: AutoCAD ActiveX VBA Reference - ActiveDimStyle Property
This style will be applied to all newly created dimensions. To change the style on an existing dimension, use the StyleName property.

To control the settings of the current document overrides, use the dimensioning system variables. See "System Variables" in the AutoCAD Command Reference for a list of dimensioning system variables.

When you change a dimensioning system variable, you are actually setting a document override for the active dimension style. You are not changing the active dimension style itself. To change the settings of a given dimension style, use the CopyFrom method. This method copies a dimension style configuration, including overrides, from a document, dimension, or other dimension style.

Dimensions created via the AutoCAD user interface are created with the active dimension style plus all document overrides. Dimensions created via ActiveX are created with the active dimension style only. To have the dimensions created via ActiveX take on the document overrides, use the CopyFrom method to copy the dimension style from the document to the active dimension style. This process will copy all existing overrides into the active dimension style.

Hmmm...DimStyle object and ActiveDimStyle Property have 2 slighly different explanations...