Author Topic: How to get layout which viewort on?  (Read 273 times)

0 Members and 1 Guest are viewing this topic.

HasanCAD

  • Swamp Rat
  • Posts: 1287
How to get layout which viewort on?
« on: March 20, 2019, 11:47:35 AM »
How to get layout which viewort on?
This is my try but not working
Code - Auto/Visual Lisp: [Select]
  1. (setq sset (ssget "x" '((0 . "VIEWPORT")))
  2. len  (sslength sset)
  3. c    0)
  4. (while (< c len)
  5.  (setq entVL (ssname sset c))
  6.  (setq entVLLYt (vla-get-layout (vlax-ename->vla-object entVL)))
  7.  (setq c (1+ c))
  8.  )

roy_043

  • Water Moccasin
  • Posts: 1680
  • BricsCAD 18
Re: How to get layout which viewort on?
« Reply #1 on: March 20, 2019, 11:50:51 AM »
You can check group code 410 in the entity list.

HasanCAD

  • Swamp Rat
  • Posts: 1287
Re: How to get layout which viewort on?
« Reply #2 on: March 20, 2019, 12:37:44 PM »
Thanks roy_043
Woking perfect

ronjonp

  • Needs a day job
  • Posts: 6913
Re: How to get layout which viewort on?
« Reply #3 on: March 20, 2019, 04:42:01 PM »
I thought I saw this answered somewhere but here you go again :P
Code - Auto/Visual Lisp: [Select]
  1. (if (setq s (ssget "_X" '((0 . "VIEWPORT") (-4 . "!=") (69 . 1))))
  2.  (mapcar 'print (mapcar '(lambda (x) (cdr (assoc 410 (entget x)))) (mapcar 'cadr (ssnamex s))))
  3. )

Windows 10 x64 - AutoCAD /C3D 2020

Custom Build PC

HasanCAD

  • Swamp Rat
  • Posts: 1287
Re: How to get layout which viewort on?
« Reply #4 on: March 21, 2019, 02:57:39 AM »
I thought I saw this answered somewhere but here you go again :P
Code - Auto/Visual Lisp: [Select]
  1. (if (setq s (ssget "_X" '((0 . "VIEWPORT") (-4 . "!=") (69 . 1))))
  2.  (mapcar 'print (mapcar '(lambda (x) (cdr (assoc 410 (entget x)))) (mapcar 'cadr (ssnamex s))))
  3. )

Thanks ronjonp

HasanCAD

  • Swamp Rat
  • Posts: 1287
Re: How to get layout which viewort on?
« Reply #5 on: March 21, 2019, 02:58:59 AM »
There was an answer in this thread and my reply on it but both deleted.
Why is this?

kdub

  • Mesozoic relic
  • SuperMod
  • Swamp Rat
  • Posts: 1267
  • class keyThumper<T>:ILazy<T>
Re: How to get layout which viewort on?
« Reply #6 on: March 21, 2019, 04:14:58 AM »
?? Other than this one ?



I thought I saw this answered somewhere but here you go again :P
Code - Auto/Visual Lisp: [Select]
  1. (if (setq s (ssget "_X" '((0 . "VIEWPORT") (-4 . "!=") (69 . 1))))
  2.  (mapcar 'print (mapcar '(lambda (x) (cdr (assoc 410 (entget x)))) (mapcar 'cadr (ssnamex s))))
  3. )
called Kerry in my other life

Sometimes the question is more important than the answer.

HasanCAD

  • Swamp Rat
  • Posts: 1287
Re: How to get layout which viewort on?
« Reply #7 on: March 21, 2019, 05:14:39 AM »
?? Other than this one ?



I thought I saw this answered somewhere but here you go again :P
Code - Auto/Visual Lisp: [Select]
  1. (if (setq s (ssget "_X" '((0 . "VIEWPORT") (-4 . "!=") (69 . 1))))
  2.  (mapcar 'print (mapcar '(lambda (x) (cdr (assoc 410 (entget x)))) (mapcar 'cadr (ssnamex s))))
  3. )

I checked the email from the swamp I find out that there are 2 threads posted with the same subject
Sorry for conflict
Is there a way to combine the 2 threads?




kdub

  • Mesozoic relic
  • SuperMod
  • Swamp Rat
  • Posts: 1267
  • class keyThumper<T>:ILazy<T>
Re: How to get layout which viewort on?
« Reply #8 on: March 21, 2019, 05:58:52 AM »
>>>>
I checked the email from the swamp I find out that there are 2 threads posted with the same subject
Sorry for conflict
Is there a way to combine the 2 threads?

Done.
called Kerry in my other life

Sometimes the question is more important than the answer.

HasanCAD

  • Swamp Rat
  • Posts: 1287
Re: How to get layout which viewort on?
« Reply #9 on: March 21, 2019, 06:01:58 AM »
>>>>
I checked the email from the swamp I find out that there are 2 threads posted with the same subject
Sorry for conflict
Is there a way to combine the 2 threads?

Done.

Thanks kdub