Author Topic: Toggle Xref layers utility ( just give me the fish, I'm hungry )  (Read 2072 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Toggle Xref layers utility ( just give me the fish, I'm hungry )
« on: December 18, 2007, 01:57:13 PM »
Anyone have a app that will toggle ( freeze/thaw ) the layer(s) for every xref in the dwg? I'm talking about the layer the xref was inserted on, not every layer in the xref itself.

thanks.
TheSwamp.org  (serving the CAD community since 2003)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Toggle Xref layers utility ( just give me the fish, I'm hungry )
« Reply #1 on: December 18, 2007, 02:04:55 PM »
nope, but i will try to whip something up
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Toggle Xref layers utility ( just give me the fish, I'm hungry )
« Reply #2 on: December 18, 2007, 02:08:10 PM »
nope, but i will try to whip something up

thanks I just don't have time at the moment.
TheSwamp.org  (serving the CAD community since 2003)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Toggle Xref layers utility ( just give me the fish, I'm hungry )
« Reply #3 on: December 18, 2007, 02:51:41 PM »
Code: [Select]
(defun c:ToggleForMark (/ ActDoc tempLay LayList LayCol LayObj)

(setq ActDoc (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(vlax-for blk (vla-get-Blocks ActDoc)
(if (= (vla-get-IsXref blk) :vlax-true)
(foreach lst (entget (vlax-vla-object->ename blk))
(if (equal (car lst) 331)
(if
(not
(vl-position
(setq tempLay (cdr (assoc 8 (entget (cdr lst)))))
LayList
)
)
(setq LayList (cons tempLay LayList))
)
)
)
)
)
(setq LayCol (vla-get-Layers ActDoc))
(foreach name LayList
(setq LayObj (vla-Item LayCol name))
(if (equal (vla-get-Freeze LayObj) :vlax-true)
(vla-put-Freeze LayObj :vlax-false)
(vla-put-Freeze LayObj :vlax-true)
)
)
(princ)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Toggle Xref layers utility ( just give me the fish, I'm hungry )
« Reply #4 on: December 18, 2007, 03:00:21 PM »
thanks a bunch Tim.

PS I've added a "regen" on the end.
TheSwamp.org  (serving the CAD community since 2003)

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Toggle Xref layers utility ( just give me the fish, I'm hungry )
« Reply #5 on: December 18, 2007, 03:02:05 PM »
thanks a bunch Tim.

PS I've added a "regen" on the end.

You're welcome.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.