Author Topic: Viewport  (Read 4380 times)

0 Members and 1 Guest are viewing this topic.

JohnK

  • Administrator
  • Seagull
  • Posts: 10657
Re: Viewport
« Reply #15 on: May 28, 2008, 12:37:27 PM »
Picky picky  :-D


*lol* Yeah, your right. That is far less obscure then a simple `cond' statement.

Heres another variant:
Code: [Select]
( (lambda ( / let )
    (defun let (bindings body)
      (eval
        (cons (append (list 'lambda (mapcar 'car bindings)) body)
              (mapcar 'cadr bindings))) )

    (let
      '((ss-vp
          (ssget "x"
                 (list '(0 . "VIEWPORT")
                       '(-4 . "/=")
                       '(68 . 1)
                       (cons 410 (getvar "ctab"))))))
      '((if (null ss-vp)
          (progn
            (alert "\n No VIEWPORTS in current layout")
            (princ) )
          ss-vp))
      )
    )
 )


EDIT:
I noticed your code changed. ...Let me evaluate, before i make my next funny.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10657
Re: Viewport
« Reply #16 on: May 28, 2008, 12:43:17 PM »
ronjonp,
Your latest wont work either. `or' is boolean and returns T or nil not the evaluation of process; so if the selection set is created, the variable will be filled with T not the VP.

Keep at er!

;P
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Viewport
« Reply #17 on: May 28, 2008, 12:56:20 PM »
I'm just messin with ya :P

This is how I would approach it (seems straight forward).
Code: [Select]
(if (setq vp-ss (ssget "x"
       (list '(0 . "VIEWPORT")
     '(-4 . "/=")
     '(68 . 1)
     (cons 410 (getvar 'ctab))
       )
)
    )
  (progn
    ;;Do Stuff
  )
  (alert "\n No VIEWPORTS in current layout")
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

JohnK

  • Administrator
  • Seagull
  • Posts: 10657
Re: Viewport
« Reply #18 on: May 28, 2008, 12:59:35 PM »
I'm just messin with ya :P

This is how I would approach it (seems straight forward).


yeah i know. and im just returning the salvo. ;p

Me too.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Viewport
« Reply #19 on: May 28, 2008, 01:11:06 PM »
Most of the user don't care about using the correct templates or procedures.  With certain projects, they will copy drawings that was done 5 years ago and make a couple of changes and then issue the drawing to the client/contractor.

Part of our problem is that we do not have people that enforces standards or audit the drawings electronicly.  The motto in the office is: If it looks good on paper, it was created in the right way".

Hey that is motto over here as well.
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans