Author Topic: How to set hpassoc to 0 if loginname = A A and/or B B or else 1  (Read 2155 times)

0 Members and 1 Guest are viewing this topic.

MvdP

  • Guest
How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« on: December 13, 2007, 11:37:31 AM »
I have a couple of coworkers and they all prefer a different settings.( F.i hpassoc 0 or 1)
Is it possible  to set hpassoc to 0 if username is A A or B B and else set to 1 in an mnl file.?

I have this for now but it ain't working.
(progn
(cond ( = getvar loginname "firstname lastname" (setvar "hpassoc" 1)))
)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« Reply #1 on: December 13, 2007, 11:40:07 AM »
i think you need an IF statement
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)

ronjonp

  • Needs a day job
  • Posts: 7531
Re: How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« Reply #2 on: December 13, 2007, 11:48:41 AM »
Code: [Select]
  (setq name (strcase (getvar 'logginame) T))
  (cond ((= name "username")
;;do stuff
)
((= name "username2")
;;do stuff
)
  )
« Last Edit: December 13, 2007, 11:52:06 AM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« Reply #3 on: December 13, 2007, 11:56:31 AM »
I think you're over engineering the solution (as a former boss used to say). Consider ...

Code: [Select]
(setvar "hpassoc"
    (if
        (member
            (strcase (getvar "loginname"))
           '("BARNEY" "FRED" "BAMBAM")
        )
        0
        1 ;; the default setting
    )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

ronjonp

  • Needs a day job
  • Posts: 7531
Re: How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« Reply #4 on: December 13, 2007, 12:45:37 PM »
I think you're over engineering the solution (as a former boss used to say). Consider ...

Code: [Select]
(setvar "hpassoc"
    (if
        (member
            (strcase (getvar "loginname"))
           '("BARNEY" "FRED" "BAMBAM")
        )
        0
        1 ;; the default setting
    )
)

Now why didn't I think of that... :-D Thanks for idea MP

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« Reply #5 on: December 13, 2007, 12:53:41 PM »
My pleasure Ron. :)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

MvdP

  • Guest
Re: How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« Reply #6 on: December 13, 2007, 01:28:53 PM »
Thank you very much.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How to set hpassoc to 0 if loginname = A A and/or B B or else 1
« Reply #7 on: December 13, 2007, 09:43:25 PM »
You're welcome MvdP.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst