Author Topic: Link from block created by sectionplane back to that sectionplane?  (Read 1264 times)

0 Members and 1 Guest are viewing this topic.

mkweaver

  • Bull Frog
  • Posts: 352
The following code will find all blocks created by sectionplane objects:
Code: [Select]
(defun GetAllSectionBlockInsertions(SectionEname / blocks blockname blockdef pair)
  ;;Get the section block ename
  (setq
    Blocks (vla-get-blocks (vla-get-activedocument(vlax-get-acad-object)))
    BlockName (cdr (assoc 2 (entget (cdr (assoc 331 (entget (cdr (assoc 360(entget SectionEname)))))))))
    BlockDef (entget (vlax-vla-object->ename (vla-item blocks BlockName)))
    )
  (mapcar
    (function
      (lambda(pair)
(cdr pair)
)
      )
    (vl-remove-if-not
      (function
(lambda(pair)
  (= 331 (car pair))
  )
)
      BlockDef
      )
    )
  )

Now I'm looking for a way to find the sectionplane object given the block it created.

Any pointers?