MSasu 发表于 2022-7-6 12:01:29

@Lee, are you learning Python also? Since their examples are recommended to be based on “Spam, Eggs and Bacon”…

Lee Mac 发表于 2022-7-6 12:03:03

No I'm not actually - I'm learning (or trying to learn) C++, Eggs and Bacon was just the first thing that came to mind... I was hungry I suppose

KRBeckman 发表于 2022-7-6 12:07:10

I got a coupe more questions...
 
With this code:
 

(setq tpm (if   (getkword       (strcat "\nSetting to Change : "))   "Continue"))
 
I'm getting this in my commmand line:
 
 
**My main problem is that the line for "Setting to Change..." is broken into 2 lines, is there a way to force this onto one line? I have plenty of room in my command line yet, so I don't believe its a margins thing. Anybody got any ideas??? ** -Disregard this question... when the user is prompted it shows up on one line, then changes...
 
The other, alot more minor thing, is that I would like to underline the "Current Settings" line of text in the command line. Is this possible?

KRBeckman 发表于 2022-7-6 12:10:07

Nevermind found it.... needed "( (eq tpm "Cont")", not ( (eq tmp "Cont")"
 
Can someone please tell me why my loop won't end???
 

;___________________________________________________________________________________________;;      i. Top Menu                                                                              ;;¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯;   (while (not ext)(princ "\n \nCurrent Settings: ")(princ (strcat "\nFace Type: " fat))(princ (strcat "\nArray Type: " art))(if (= art "Rectangular")(princ (strcat "\nOscillation: " osc)))(princ (strcat "\nLayer: "      (if (= las "Temp") "Temp" (getvar 'clayer))))(princ (strcat "\nHide Edges: " hed))(initget "Face Array oScill layeR hidE Cont")(setq tpm (cond   ( (getkword(strcat "\nSetting to Change : ")))   ("Cont")));___________________________________________________________________________________________;;      i. Face Type                                                                           ;;¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯;(cond( (eq tpm "Face")   (initget "First miDdle lAst")          (setq fat (cond               ( (getkword (strcat "\nFace Type? ["            (if (= fat "First" ) """First" )         "/"            (if (= fat "miDdle") "" "miDdle")         "/"            (if (= fat "lAst") ""   "lAst")         "]: ")))            (fat)))            )         ;___________________________________________________________________________________________;;      ii. Array Type                                                                           ;;¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯;( (eq tpm "Array")   (initget "Rectangular Circular")          (setq art (cond               ( (getkword             (strcat "\nArray Type? ["            (if (= art "Rectangular") "" "Rectangular")       "/"            (if (= art "Circular"   ) ""    "Circular"   )       "]: ")))               (art)))            );___________________________________________________________________________________________;;      iii. Third and Fourth Point Selection Oscillation                                        ;;¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯;( (eq tpm "oScill")    (if (= art "Circular")      (progn (initget "Yes No") (setq cat (cond      ((getkword (strcat "\nArray type is not currenty set to "         "rectangular, change to circular? : "         )))      ("Yes"))) (if (= cat "Yes")   (setq osc "Yes"art "Rectangular")   )))   );___________________________________________________________________________________________;;      iii. Layer selection                                                                     ;;¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯;( (eq tpm "layeR")   (initget "Current Temp")            (setq las (cond                  ( (getkword (strcat "\nLayer? ["             (if (= las "Current") "" "Current")         "/"            (if (= las "Temp"   ) ""    "Temp"   )         "]: ")))            (las)))            );___________________________________________________________________________________________;;      iv. Hide edges                                                                           ;;¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯;( (eq tpm "hidE")   (initget "Yes No")             (setq hed (cond               ( (getkword (strcat "\nHide Inside Edges? : ")))          (hed)))            );___________________________________________________________________________________________;;      iv. End Loop (Continue)                                                                  ;;¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯;( (eq tmp "Cont")   (setq ext 1)   ))         )            
 
I'm guessing its going to be a little detail, but I can't find it.

alanjt 发表于 2022-7-6 12:11:55

LoL
Lee, you were talking about being immature...
 

(princ (strcat "\nFace Type: " fat))(princ (strcat "\nArray Type: " art))
 

KRBeckman 发表于 2022-7-6 12:16:52

lol, very nice

KRBeckman 发表于 2022-7-6 12:20:43

I keep coming up with more questions.... but how would I change a prompt to accept a mouse click in addition to a text input.
 
And then if it was a mouse click, how would use the coordinates of that point and apply it to a variable?
 
Not sure if this makes 100% sense, so for an example look at the autocad arc command, after you initiate the are command you have an option you can activate by hitting the "c" key, or you can click and it accepts that as the first point of the arc.

Lee Mac 发表于 2022-7-6 12:23:06

*Hint* Fully read about initget in the Developer Help

KRBeckman 发表于 2022-7-6 12:25:05

I did, and I understand that if you use 128 as the bit-code for the initget function that it will allow you to inputer keyboard entries into a getpoint function, but I don't see how that combines the getkword to make sure the user is only entering either the options you give them, or a point.
 
Sorry if I'm being thick, I'm just not very good at figuring this kind of stuff out fromt the help files.

Lee Mac 发表于 2022-7-6 12:29:02

How about this part
 
页: 1 [2]
查看完整版本: More AutoCAD-like programs