Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Turn Off Annotative Property of Dimstyle?

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
944 Views, 2 Replies

Turn Off Annotative Property of Dimstyle?

I have found several routines (see below) to make a dimstyle annotative, but
how can I turn it off? Can this be modified to do the opposite? Thanks for
any help.

;;; For Dimstyles use the following
;;; (SetDimAnnotative "Style Name")
;;;
;;; Original Code by: Harrie Zeha
;;; Autodesk discussion post thread:
;;; http://discussion.autodesk.com/thread.jspa?messageID=5730957

(defun SetDimAnnotative (Name / *doc* *dims* app xd1 xd2 rt1 rt2)
(vl-load-com)
(setq *dims* (vla-get-dimstyles
(vla-get-activedocument (vlax-get-acad-object))
)
)
(vlax-for itm *dims*
(setq *dimstl* (cons (vla-get-name itm) *dimstl*))
)
(if (member Name *dimstl*)
(progn
(setq obj (vla-item *dims* Name)
app "AcadAnnotative"
)
(regapp app)
(setq xd1 (vlax-make-safearray vlax-vbInteger '(0 . 5)))
(vlax-safearray-fill
xd1
(list 1001 1000 1002 1070 1070 1002)
)
(setq xd2 (vlax-make-safearray vlax-vbVariant '(0 . 5)))
(vlax-safearray-fill
xd2
(list "AcadAnnotative"
"AnnotativeData"
"{"
(vlax-make-variant 1 vlax-vbInteger)
(vlax-make-variant 1 vlax-vbInteger)
"}"
)
)
(vla-setxdata obj xd1 xd2)
(vla-getxdata obj app 'rt1 'rt2)
(mapcar
(function (lambda
(x y)
(cons x y)
)
)
(vlax-safearray->list rt1)
(mapcar 'vlax-variant-value (vlax-safearray->list rt2))
)
)
)
)
--
Daniel J. Altamura, Registered Architect
Altamura Architectural Consulting
and SoftWorx, Autodesk Authorized Developer
http://partnerproducts.autodesk.com/popups/company.asp?rdid=2139
------------------------------------------------------------------------------
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

For anyone interested, I found the solution, courtesy of Autodesk Developer
support.

;;; Turn On:
(list "AcadAnnotative"
"AnnotativeData"
"{"
(vlax-make-variant 1 vlax-vbInteger)
(vlax-make-variant 1 vlax-vbInteger)
"}"
)

;;; Turn Off:
(list "AcadAnnotative"
"AnnotativeData"
"{"
(vlax-make-variant 0 vlax-vbInteger)
(vlax-make-variant 0 vlax-vbInteger)
"}"
)

--
Daniel J. Altamura, Registered Architect
Altamura Architectural Consulting
and SoftWorx, Autodesk Authorized Developer
http://partnerproducts.autodesk.com/popups/company.asp?rdid=2139
------------------------------------------------------------------------------

"Daniel J. Altamura"; "R.A." wrote in message
news:6200368@discussion.autodesk.com...
I have found several routines (see below) to make a dimstyle annotative, but
how can I turn it off? Can this be modified to do the opposite? Thanks for
any help.

;;; For Dimstyles use the following
;;; (SetDimAnnotative "Style Name")
;;;
;;; Original Code by: Harrie Zeha
;;; Autodesk discussion post thread:
;;; http://discussion.autodesk.com/thread.jspa?messageID=5730957

(defun SetDimAnnotative (Name / *doc* *dims* app xd1 xd2 rt1 rt2)
(vl-load-com)
(setq *dims* (vla-get-dimstyles
(vla-get-activedocument (vlax-get-acad-object))
)
)
(vlax-for itm *dims*
(setq *dimstl* (cons (vla-get-name itm) *dimstl*))
)
(if (member Name *dimstl*)
(progn
(setq obj (vla-item *dims* Name)
app "AcadAnnotative"
)
(regapp app)
(setq xd1 (vlax-make-safearray vlax-vbInteger '(0 . 5)))
(vlax-safearray-fill
xd1
(list 1001 1000 1002 1070 1070 1002)
)
(setq xd2 (vlax-make-safearray vlax-vbVariant '(0 . 5)))
(vlax-safearray-fill
xd2
(list "AcadAnnotative"
"AnnotativeData"
"{"
(vlax-make-variant 1 vlax-vbInteger)
(vlax-make-variant 1 vlax-vbInteger)
"}"
)
)
(vla-setxdata obj xd1 xd2)
(vla-getxdata obj app 'rt1 'rt2)
(mapcar
(function (lambda
(x y)
(cons x y)
)
)
(vlax-safearray->list rt1)
(mapcar 'vlax-variant-value (vlax-safearray->list rt2))
)
)
)
)
--
Daniel J. Altamura, Registered Architect
Altamura Architectural Consulting
and SoftWorx, Autodesk Authorized Developer
http://partnerproducts.autodesk.com/popups/company.asp?rdid=2139
------------------------------------------------------------------------------
Message 3 of 3
renmanz
in reply to: Anonymous

This is what i have been looking for but it dosent seem to work for me. I copied to note pad and saved it as a lsp file. when i run the lisp it says it loaded successfully. Using AutoCAD 2012

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost