TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: HasanCAD on March 20, 2019, 11:47:35 AM

Title: How to get layout which viewort on?
Post by: HasanCAD 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.   )
Title: Re: How to get layout which viewort on?
Post by: roy_043 on March 20, 2019, 11:50:51 AM
You can check group code 410 in the entity list.
Title: Re: How to get layout which viewort on?
Post by: HasanCAD on March 20, 2019, 12:37:44 PM
Thanks roy_043
Woking perfect
Title: Re: How to get layout which viewort on?
Post by: ronjonp 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. )
Title: Re: How to get layout which viewort on?
Post by: HasanCAD 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
Title: Re: How to get layout which viewort on?
Post by: HasanCAD 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?
Title: Re: How to get layout which viewort on?
Post by: kdub_nz 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. )
Title: Re: How to get layout which viewort on?
Post by: HasanCAD 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?



Title: Re: How to get layout which viewort on?
Post by: kdub_nz 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.
Title: Re: How to get layout which viewort on?
Post by: HasanCAD 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