How to drill into Dynamic Array object to obtain entity data of source objects?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all. A little background:
I'm trying to access the contents of a dynamic array object that contains dynamic blocks. I have individual conveyor bed dynamic blocks that could be strung together in rectangular arrays. The source object could be manipulated through grips or property palette before arraying, or even after the array has been created through the ARRAYEDIT command. These options make it a nice idea to create dynamic arrays of these dynamic blocks so that they can be strung together and create long runs of these conveyor beds which are easily manipulated, and perfectly spaced.
My problem is that each of our dynamic blocks contain key properties that are extracted and then sent to a CSV file for Excel processing in order to create parts lists. My extraction lisp filters for our dynamic blocks since our effective names follow a key pattern and my SSGET grabs anonymous blocks with '*U* and filters for effective names as well - so we pick up only our dynamic blocks, whether they have been manipulated from their default state or not. Apparently, array objects created by using the ARRAYRECT command with the ASSOCIATIVE option active create kind of a dynamic block on the fly that are also anonymous, so I'm trying to figure out how to test them and drill into them to collect all our dynamic blocks and mine their data.
Here's a code snippet:
(princ "\nSelect dynamic blocks for export ") (setq SS (ssget (list (cons 0 "INSERT")(cons 2 (strcat "`*U*," "###_*," "TGWSP-*"))))) (setq INC 0) (setq FINALSS (ssadd));creates an empty SS (while (setq EN (ssname SS INC)) (setq BLOCKNAME (vla-get-effectivename (vlax-ename->vla-object EN))) (setq LASTBLOCKCHR (substr BLOCKNAME (strlen BLOCKNAME) 1));;finds version suffix (if (wcmatch LASTBLOCKCHR "#");;if block is original beta non-indexed (ends in a number) (setq ROOTBLOCKNAME BLOCKNAME );;set rootblockname=blockname to be caught (setq ROOTBLOCKNAME (substr BLOCKNAME 1 (- (strlen BLOCKNAME) 1)));;if it is a later version block - set rootblockname to be caught w/o version letter ) (if (and (wcmatch (substr BLOCKNAME 1 4 ) "###_")(not (wcmatch BLOCKNAME "*EFWK*")) (not (vl-some '(lambda (s) (wcmatch ROOTBLOCKNAME s)) NAUGHTlist))) (progn (setq IC (substr BLOCKNAME 1 3 )) (ssadd EN FINALSS);add to the new SS, finalss (setq BLKDEF (vlax-ename->vla-object EN));check for, number and collect bogus mirrored block handles (setq sclX (vlax-get BLKDEF 'XScaleFactor)) (setq sclY (vlax-get BLKDEF 'YScaleFactor)) (if (or (minusp sclX) (minusp sclY)) ;find if either block scale factor is negative (progn (Setq ALERTFLAG 1);set ALERTFLAG 1 (if (= MIRRLIST nil);if no list exists, create one, if it does, append it (setq MIRRLIST (list (vla-get-handle blkdef)) COUNTVAR 1);if... do this (setq MIRRLIST (append MIRRLIST(list (vla-get-handle BLKDEF))) COUNTVAR (+ 1 COUNTVAR));else ) ) ) ) ) (setq INC (1+ INC)) ) ...do processing of data on FINALSS.....
Any idea how to tell if dynamic array anonymous blocks are different from other dynamic blocks?