Dimension Layer Lisp Help for 2015

Dimension Layer Lisp Help for 2015

Anonymous
Not applicable
367 Views
2 Replies
Message 1 of 3

Dimension Layer Lisp Help for 2015

Anonymous
Not applicable

AutoCAD seems to freeze for 5-10 minutes any time I try to copy/paste from one drawing to another, or bring in a tool pallette file.  I removed the below dimesion lisp and AutoCAD seems to run fine.  Any idea why this might be happening?  It is clearly related to the below lisp that is used to change any dimension added to the "DIMENSION" layer automatically.  Thanks in advance!

 

(if (not (tblsearch "layer" "DIMENSION"))
(progn
(entmake
(list
'(0 . "LAYER")
'(100 . "AcDbSymbolTableRecord")
'(100 . "AcDbLayerTableRecord")
(cons 2 "DIMENSION")
'(70 . 0)
(cons 62 3)
)
)
) ;_progn
) ;_if

(if (not acdb:reactor)
(setq acdb:reactor
(vlr-AcDb-Reactor
nil
'((:vlr-objectappended . a+objcreated))
)
)
)

(if (not acdb:reactor2)
(setq acdb:reactor2
(vlr-command-reactor
nil
'((:vlr-commandended . a+commandended))
)
)
)

(defun a+objcreated (Reac Args / ent)
(setq ent (cadr args))
(if (and
(null (member ent objcreated))
)
(progn
(setq objcreated (cons ent objcreated))
)
)
)

(defun a+commandended (Reac Args / ent entl vla)
(foreach ent objcreated

(if (and
ent
(setq entl (entget ent))
(member (cdr (assoc 0 entl)) (list "DIMENSION" "LEADER"))
(/= (cdr (assoc 8 entl)) "DIMENSION")
)
(progn
(setq vla (vlax-ename->vla-object ent))
(vla-put-layer vla "DIMENSION")
(vla-update vla)
)
)
)
(setq objcreated nil)
(princ)
)

0 Likes
368 Views
2 Replies
Replies (2)
Message 2 of 3

doglips
Advocate
Advocate

It wouldn't suprise me to think that the reactors in the lisp would slow down AutoCAD.

What exactly do you need the lisp to do?

0 Likes
Message 3 of 3

ВeekeeCZ
Consultant
Consultant

Hmm, ACAD 2016 is solving the issue.

As you said, you're familiar with ToolPalettes, so why not use this for Dimensions......

 

You can try this routine by CADStudio.... It!s a reactor as well, hopefully better written since this was published at ADSK app store

See this video.

0 Likes