vlax-put-property
how do I assign the property of one to anouther?I want to take my file name and assign it to my layout tab.
This is my code so far: How do I use the vlax-put-property? I am not looking for code, just an example
(defun C:test ()(vl-load-com)(setq acadObject (vlax-get-acad-object)) (setq acadDocument (vlax-get-property acadObject 'ActiveDocument))(setq acadName (vlax-get-property acadDocument 'Name))(setq PaperSpace (vlax-get-property acadDocument 'PaperSpace))(setq PaperSpaceLayout (vlax-get-property PaperSpace 'Layout))(setq LayoutName (vlax-get-property PaperSpaceLayout 'Name))(vlax-put-property (vla-get-Layout PaperSpace) acadName)(princ))
The (vlax-put-property (vla-get-Layout PaperSpace) acadName) part I pulled from the net and it seemed promising, but...
Thanks Here's another way, using the method of your code:
(defun c:test ( / doc ) (vl-load-com) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-put-name (vla-get-Layout (vla-get-Paperspace doc) ) (vla-get-name doc) ) (princ)) Perhaps see here also:
http://www.cadtutor.net/forum/showpost.php?p=258403&postcount=9 lee mac
you make it look easy
As always, thanks Thanks Cadman,
This is how I might approach the task of renaming layouts, using the vl-catch-all-apply allows for duplicate layout names and layout names that contain invalid symbols.
(defun _PutLayoutName ( layout name / _CatchApply ) (vl-load-com) (defun _CatchApply ( _function _arguments ) (if (not (vl-catch-all-error-p (setq result (vl-catch-all-apply (function _function) _arguments) ) ) ) result ) ) (if (setq layout (_CatchApply vla-item (list (vla-get-layouts (vla-get-ActiveDocument (vlax-get-acad-object) ) ) layout ) ) ) (_CatchApply vla-put-name (list layout name)) )) it will take me time to digest the code you provide above.
I will be back with questions but not any time soon, swamped with "work"
Thanks for showing me how you might go about it,
页:
[1]