Author Topic: Which is more beautiful . . .  (Read 10912 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Re: Which is more beautiful . . .
« Reply #15 on: September 29, 2010, 03:40:31 PM »
Code: [Select]
(if (eq 1 (getvar "cvport"))
                        'PaperSpace
                        'ModelSpace
                    )

So that's how you do that!! I have some ancient code to update now. LOL

thanks MP, always nice to see how your mind works.
TheSwamp.org  (serving the CAD community since 2003)

LE3

  • Guest
Re: Which is more beautiful . . .
« Reply #16 on: September 29, 2010, 04:10:21 PM »
If there are more options.... then will go with the alias:

Command: L

And forget about any complex customization -  :-P

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Which is more beautiful . . .
« Reply #17 on: September 29, 2010, 04:33:37 PM »
What Luis said ^^

Form follows function

so, for the quoted example  'L'  via the PGP file definitions.


Otherwise, in principle , C


or to keep John happy, A  :)

(added:kdub] we all realise that beauty is not necessarily related to functionality, yes ??
« Last Edit: September 29, 2010, 05:06:34 PM by Kerry »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

JohnK

  • Administrator
  • Seagull
  • Posts: 10603
Re: Which is more beautiful . . .
« Reply #18 on: September 29, 2010, 04:59:11 PM »
*sigh* I choose method Q!


Someone asking question: What came first the Chicken or the Egg?
Some people here: The Camel because it can live longer in the desert.
*palm to face*
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Which is more beautiful . . .
« Reply #19 on: September 29, 2010, 09:09:01 PM »
Thanks for playing!

As some of you know I'm no longer in the AutoCAD, AutoLISP, coding game.  This was a physiological profiling exercise.  Thanks for the feedback!

jb
« Last Edit: September 30, 2010, 07:07:03 AM by jbuzbee »
James Buzbee
Windows 8

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Which is more beautiful . . .
« Reply #20 on: September 30, 2010, 12:01:19 AM »

Quote
This was a physiological profiling excesses.

That's funny - I don't care who you are !!
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Daniel J. Ellis

  • Swamp Rat
  • Posts: 811
Re: Which is more beautiful . . .
« Reply #21 on: September 30, 2010, 03:27:51 AM »
C is so much better than the others. A, makes me cringe, and B provided a WTHIT moment.

I've not heard of a WITHIT moment before.

dJE
===
dJE

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Which is more beautiful . . .
« Reply #22 on: September 30, 2010, 07:42:00 AM »
what the hell is that ?

/guess
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

jbuzbee

  • Swamp Rat
  • Posts: 851
Re: Which is more beautiful . . .
« Reply #23 on: September 30, 2010, 10:17:58 AM »
Think about it:  I've noticed an intersting trend in message boards.  People are more free to respond due to the anonymity of the internet.  This site, which attracts very intelligent and technically advanced users, illustrates very different personality traits.  This thread alone clearly identifies conservatism, complexity, and creativity (option C!).

That's what makes this site and forum such a wonderful resource.  I hope it never changes . . ..
James Buzbee
Windows 8

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Which is more beautiful . . .
« Reply #24 on: September 30, 2010, 10:21:16 AM »
...
That's what makes this site and forum such a wonderful resource.  I hope it never changes . . ..

X2  :-)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

HasanCAD

  • Swamp Rat
  • Posts: 1420
Re: Which is more beautiful . . .
« Reply #25 on: September 30, 2010, 02:37:44 PM »
C with a litle change

Code: [Select]
(defun c:addline (/ e p1 p2)
  (and (setq p1 (getpoint "\nSpecify first point:"))
       (setq p2 (getpoint p1 "\nSpecify next point:"))
       )
  (entmakex (list
             (cons 0 "LINE")
             (cons 10 p1)
             (cons 11 p2)
             ))
  (princ)
  )

pkohut

  • Bull Frog
  • Posts: 483
Re: Which is more beautiful . . .
« Reply #26 on: September 30, 2010, 02:44:46 PM »
C with a litle change

Code: [Select]
(defun c:addline (/ e p1 p2)
  (and (setq p1 (getpoint "\nSpecify first point:"))
       (setq p2 (getpoint p1 "\nSpecify next point:"))
       )
  (entmakex (list
             (cons 0 "LINE")
             (cons 10 p1)
             (cons 11 p2)
             ))
  (princ)
  )

You broke it. Pick first point. Right click for second point. "entmakex" should not run, p2 is nil.
New tread (not retired) - public repo at https://github.com/pkohut

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Which is more beautiful . . .
« Reply #27 on: September 30, 2010, 02:54:03 PM »
C with a litle change

Code: [Select]
(defun c:addline (/ e p1 p2)
  (and (setq p1 (getpoint "\nSpecify first point:"))
       (setq p2 (getpoint p1 "\nSpecify next point:"))
       )
  (entmakex (list
             (cons 0 "LINE")
             (cons 10 p1)
             (cons 11 p2)
             ))
  (princ)
  )

From a code perspective it would be good if the function returned something so you could do something with it after it's drawn  :-D:

(if (setq line (addline))
  (command "_move" line "" pause pause)
  (alert "oh noes!!")
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Lee Mac

  • Seagull
  • Posts: 12905
  • London, England

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Which is more beautiful . . .
« Reply #29 on: September 30, 2010, 03:23:54 PM »
Alright... my turn!!

Code: [Select]
Option Explicit

Public Sub MainLine()
    Dim Point1 As Variant
    Dim Point2 As Variant
    Dim line As AcadLine
   
    If MyGetPoints(Point1, Point2) = 0 Then  'no CANCEL
        Set line = ThisDrawing.ModelSpace.AddLine(Point1, Point2)
    End If
End Sub


Private Function MyGetPoints(pt1 As Variant, pt2 As Variant) As Integer
    ' This sub returns two points, or an error flag if cancelled

    On Error Resume Next
   
    pt1 = ThisDrawing.Utility.getPoint(, "Specify first point:")
    If Err Then
        MyGetPoints = -1
        Exit Function
    End If
    pt2 = ThisDrawing.Utility.getPoint(pt1, "Specify second point:")
    If Err Then
        MyGetPoints = -1
        Exit Function
    End If
   
On Error GoTo 0
End Function

 :roll:
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io