Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
pbejse
Posts: 2,511
Registered: ‎11-24-2009
Message 11 of 13 (177 Views)

Re: "Hatch to back" reactor

02-16-2013 02:11 AM in reply to: msarqui

msarqui wrote:


It is possible to do this in model and paper space at the same time? Like in on shot?

 

Thanks!


Not one shot but sorta :smileyhappy:

 

(defun c:HatchBack  (/ HatchColl Dict sorttable)
  (vlax-for layout  (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object)))
    (setq HatchColl nil
          Dict      (vla-getextensiondictionary layout))
    (if (vl-catch-all-error-p
          (setq sorttable (vl-catch-all-apply 'vla-item (list dict "ACAD_SORTENTS"))))
      (setq sorttable (vla-addObject dict "ACAD_SORTENTS" "AcDbSortentsTable")))
    (vlax-for itm  layout
      (if (eq (vla-get-objectname itm) "AcDbHatch")
        (setq HatchColl (cons itm HatchColl))))
    (and HatchColl (vlax-invoke sorttable 'MoveToBottom HatchColl)
         )
    )(princ)
  )

 

Distinguished Contributor
msarqui
Posts: 139
Registered: ‎09-14-2010
Message 12 of 13 (162 Views)

Re: "Hatch to back" reactor

02-18-2013 05:29 PM in reply to: pbejse

It works like a charm.

 

Thanks pbejse!

*Expert Elite*
pbejse
Posts: 2,511
Registered: ‎11-24-2009
Message 13 of 13 (142 Views)

Re: "Hatch to back" reactor

02-19-2013 08:12 PM in reply to: msarqui

msarqui wrote:

It works like a charm.

 

Thanks pbejse!


Glad it works for you msarqui

 

Cheers

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.