DIMLAYER system variable not consistently working
There is a new system variable in AutoCAD 2016 called DIMLAYER, which when set to a layer name, it puts new dimensions on that layer automatically.
When the command line DIM is used, the dimension goes on the layer specified. However, when the dimension is made with the traditional AutoCAD drop-down menu, or custom tool bars, it does not work, it goes on the current layer. Anyone else have this problem?
Re: DIMLAYER system variable not consistently working
Quote:
Originally Posted by
Brian C
There is a new system variable in AutoCAD 2016 called DIMLAYER, which when set to a layer name, it puts new dimensions on that layer automatically.
When the command line DIM is used, the dimension goes on the layer specified. However, when the dimension is made with the traditional AutoCAD drop-down menu, or custom tool bars, it does not work, it goes on the current layer. Anyone else have this problem?
By design, DIMLAYER is only observed using the DIM Command... This one of the many reasons I voted against this as a new feature, it's incomplete, and poorly implemented, IMHO.
You'll need to roll your own Command Reactor, or .NET Event handler to filter for DIM* Commands, and either store CLAYER, set CLAYER == DIMLAYER, restore CLAYER when done, or retroactively apply DIMLAYER value to resultant Dimension-typed entities after-the-fact.
Cheers
Re: DIMLAYER system variable not consistently working
That is as designed as far as I know. The old pull down menus are deprecated and were not updated to call the DIM command, and the now "classic" commands apparently do not honor the DIMLAYER sysvar.
Re: DIMLAYER system variable not consistently working
Quote:
Originally Posted by
BlackBox
You'll need to roll your own Command Reactor, or .NET Event handler to filter for DIM* Commands, and either store CLAYER, set CLAYER == DIMLAYER, restore CLAYER when done, or retroactively apply DIMLAYER value to resultant Dimension-typed entities after-the-fact.
FWIW -
This is an 'annoauto' app I developed back in 2012, using .NET API to implement a Close() Method Override of an ObjectOverrule (thanks to Tony's help!):
http://www.screencast.com/users/Blac...4-91cbf42be6c7
Re: DIMLAYER system variable not consistently working
Thanks Blackbox and Rkm for the clarification. I have been using Autolisp for years to set CLAYER to the dimension layer, then set back to the previous layer after finishing dimensioning. I will look at the .NET app.
Re: DIMLAYER system variable not consistently working
Quote:
Originally Posted by
Brian C
I have been using Autolisp for years to set CLAYER to the dimension layer, then set back to the previous layer after finishing dimensioning.
Then you're better prepared than most prior to DIMLAYER being introduced, and already equipped to handle the gaps for same; just keep using what you already have, if not enhance your existing code to now also account for DIM Command (+ DIMLAYER, in lieu of DIM* Commands + CLAYER, if that makes sense?).
Quote:
Originally Posted by
Brian C
I will look at the .NET app.
No worries - basically, it's an MLEADER sample, that demonstrates the changing of MLeader's Style when layer is changed, and when the layer is changed as the Style is in kind, in order to easily adhere to standards. Same principle for Text, and Dimension entities.
Cheers