Can I map an instance of a block to the layout it resides on?
If so, point me in the right direction, please.
What little I have so far is listed below.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; conditions: * multiple layuot tabs
;;; * (1) instance of title block inserted on some but not all layuot tabs
;;; goal : associate each title block (entity or object) with its respective layout
;;; so the end user can select the target title block by its associated
;;; layout name from a dialog list_box ragardless of the 'current' layuot status
;;; assumed info requirements:
;;; * list of layouts and/or layout blocks
;;; * list of entity names or object IDs of each instance of title block
;;; * etc. , etc. , ...
;;; problem : how to develop and report the assoiations so correct selection
;;; can be made by the end user
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun map-titleblocks-2-layouts (/ current-doc current-layout layout-list ps-layouts)
(setq current-doc (vla-get-activedocument (vlax-get-acad-object)))
(setq current-layout (vlax-get-property current-doc 'ActiveLayout))
(setq layout-list nil)
(vlax-for xi (vla-get-layouts current-doc)
(setq layout-list (cons (list
(vlax-get-property xi 'TabOrder)
(vlax-get-property xi 'Name)
(vlax-get-property xi 'Block)) layout-list)))
(setq ps-layouts nil)
(foreach xi (cdr (vl-sort (mapcar 'car layout-list) '<))
(foreach ix layout-list
(if (= xi (car ix))
(setq ps-layouts (append ps-layouts (list ix))) nil)))
;;; I'm stuck
)
Thank you,
Tony