View Full Version : Dimensions on DIM layer
rchalmers
2013-12-10, 07:28 PM
I just upgraded from AutoCAD2006 to AutoCAD2014. I had a .lsp routine for 2006 that would automatically put any dimension on the DIM layer when the dimension was drawn. After the dimension was completed it returned you back to the layer you were working on. So no matter what layer you were on, when you drew a dimension it automatically put it on the DIM layer.
That routine isn't working so well in AutoCAD2014. It's inconsistent; sometimes it works and sometimes it does not.
Does AutoCAD 2014 provide this functionality within the program? If not, does anyone know where I can get a .lsp routine for AutoCAD 2014 that will do it?
Thanks!
BlackBox
2013-12-10, 08:18 PM
I too use a Visual LISP Reactor to perform actions such as this for my daily work... LISP is one of the few APIs that *can* work for several releases with few (if any) any source-code changes... If you post your code, I or someone else can help.
Also, I am moving this thread to the LISP forum.
Cheers
BlackBox
2013-12-10, 08:37 PM
Here's a quickly written reactor that uses "DIM" layer for any entity creating DIM* Command:
(vl-load-com)
(defun DimReactor:Start ()
(or *DimReactor*
(setq *DimReactor*
(vlr-command-reactor
nil
'(
(:vlr-commandcancelled . DimReactor:CommandEnded)
(:vlr-commandended . DimReactor:CommandEnded)
(:vlr-commandfailed . DimReactor:CommandEnded)
(:vlr-commandwillstart . DimReactor:CommandWillStart)
)
)
)
)
(prompt "\nDimension reactor loaded. ")
(princ)
)
(defun DimReactor:CommandEnded (rea cmd)
(if
(and
*DimReactorLayer*
(wcmatch
(strcase (car cmd))
"DIMA*,DIMB*,DIMC*,DIMD*,DIMI*,DIMJ*,DIML*,DIMO*,DIMR*,DIMSP*,QDIM"
)
)
(progn
(setvar 'clayer *DimReactorLayer*)
(setq *DimReactorLayer* nil)
)
)
)
(defun DimReactor:CommandWillStart (rea cmd / layerName)
(if
(wcmatch
(strcase (car cmd))
"DIMA*,DIMB*,DIMC*,DIMD*,DIMI*,DIMJ*,DIML*,DIMO*,DIMR*,DIMSP*,QDIM"
)
(progn
(setq *DimReactorLayer* (getvar 'clayer))
(vla-add
(vla-get-layers (vla-get-activedocument (vlax-get-acad-object)))
(setq layerName "DIM")
)
(setvar 'clayer layerName)
)
)
)
(defun c:DimReactorStart ()
(DimReactor:Start)
)
(defun c:DimReactorStop ()
(if *DimReactor*
(progn
(vlr-remove *DimReactor*)
(setq *DimReactor* nil)
)
)
(prompt "\n** Dimension reactor stopped ** ")
(princ)
)
;; Uncomment next line to start automatically.
;;(DimReactor:Start)
(princ)
jayhay35365091
2013-12-10, 11:23 PM
Lee Mac has a routine for this. It can go further than dims. You can specifiy any object type to go on any specified layer. i.e Text, Revclouds, Tables, leaders ... etc.
antistar
2014-10-07, 01:52 AM
Hi BlackBox,
Can implement a function to disable this routine?
Something like the opposite of DimReactor:Start.
Thanks in advance.
BlackBox
2014-10-07, 12:41 PM
Hi BlackBox,
Can implement a function to disable this routine?
Something like the opposite of DimReactor:Start.
Thanks in advance.
No problem; I've added a DimReactorStop and DimReactorStart function to the bottom of the code found here (http://forums.augi.com/showthread.php?153685-Dimensions-on-DIM-layer&p=1253451&viewfull=1#post1253451).
Cheers
antistar
2014-10-07, 01:58 PM
No problem; I've added a DimReactorStop and DimReactorStart function to the bottom of the code found here (http://forums.augi.com/showthread.php?153685-Dimensions-on-DIM-layer&p=1253451&viewfull=1#post1253451).
Cheers
PERFECT!
Thanks a lot for your attention.
Best regards. :-)
shaileshmarwadi20724645
2016-04-04, 04:19 AM
where to put this code to get dimension on dim layer
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.