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

XDATA to a VIEWPORT

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
417 Views, 4 Replies

XDATA to a VIEWPORT

Is it there any option to assign an XDATA to a VIEWPORT, becouse I can do it
to any other entity but not to a VIEWPORT

Thanks
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

I think not. Xdata management is critical to viewport functionality. So
AutoDesk reserved xdata use for that object type to itself.

"Gustavo_Guidi" wrote in message
news:6394895@discussion.autodesk.com...
Is it there any option to assign an XDATA to a VIEWPORT, becouse I can do it
to any other entity but not to a VIEWPORT

Thanks
Message 3 of 5
Anonymous
in reply to: Anonymous

> Is it there any option to assign an XDATA to a VIEWPORT, becouse I can do it
> to any other entity but not to a VIEWPORT

It is not the same thing, but you can make a polygonal Viewport
and assing Xdata to the polyline associated.

--
Marc'Antonio Alessi

http://alessi.xoom.it//alessi/Programmi.htm
(vl-string-translate "1234567890" "ie@mst.lan" "499825513610716")
2D Parametric for 2000-2010
Message 4 of 5
Anonymous
in reply to: Anonymous

(defun kcs_putxdata (obj app types values / typearray typevalue)
(vl-load-com)
(if (= (type obj) 'ENAME)
(setq obj (vlax-ename->vla-object obj))
)
(setq
TypeArray (vlax-make-safearray vlax-vbinteger (cons 0 (length types)))
Types (vlax-safearray-fill TypeArray (cons 1001 types))
TypeValue (vlax-make-safearray vlax-vbVariant (cons 0 (length values)))
Values (vlax-safearray-fill TypeValue (cons app values))
)
(vla-setXdata obj Types Values)
)

;Example
(setq vp (car (entsel "\nSelect viewport: ")))
(setq dtype "FPLAN" scale 96 display "Normal") ; for testing below
(kcs_putxdata vp "KCS_DwgType" '("1000" "1070" "1000") (list dtype scale display))

;This is now included in the xdata:
("KCS_DwgType" (1000 . "FPLAN") (1070 . 96) (1000 . "Normal"))

Ken Krupa
Autodesk Authorized Developer
Krupa CADD Solutions
www.krupacadd.com


Gustavo_Guidi wrote:
> Is it there any option to assign an XDATA to a VIEWPORT, becouse I can do it
> to any other entity but not to a VIEWPORT
>
> Thanks
Message 5 of 5
Anonymous
in reply to: Anonymous

Thanks, I will try it


"Ken Krupa" escribió en el mensaje
news:6395447@discussion.autodesk.com...
(defun kcs_putxdata (obj app types values / typearray typevalue)
(vl-load-com)
(if (= (type obj) 'ENAME)
(setq obj (vlax-ename->vla-object obj))
)
(setq
TypeArray (vlax-make-safearray vlax-vbinteger (cons 0 (length types)))
Types (vlax-safearray-fill TypeArray (cons 1001 types))
TypeValue (vlax-make-safearray vlax-vbVariant (cons 0 (length values)))
Values (vlax-safearray-fill TypeValue (cons app values))
)
(vla-setXdata obj Types Values)
)

;Example
(setq vp (car (entsel "\nSelect viewport: ")))
(setq dtype "FPLAN" scale 96 display "Normal") ; for testing below
(kcs_putxdata vp "KCS_DwgType" '("1000" "1070" "1000") (list dtype scale
display))

;This is now included in the xdata:
("KCS_DwgType" (1000 . "FPLAN") (1070 . 96) (1000 . "Normal"))

Ken Krupa
Autodesk Authorized Developer
Krupa CADD Solutions
www.krupacadd.com


Gustavo_Guidi wrote:
> Is it there any option to assign an XDATA to a VIEWPORT, becouse I can do
> it
> to any other entity but not to a VIEWPORT
>
> Thanks

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

Post to forums  

Autodesk Design & Make Report

”Boost