Author Topic: 2013 Command line syntax highlighting?  (Read 2292 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
2013 Command line syntax highlighting?
« on: July 05, 2012, 08:34:35 PM »
Where command line options show Caps in each option highlighted.
Is this possible to activate in lisp or just .NET specific apps?

KewlToyZ

  • Guest
Re: 2013 Command line syntax highlighting?
« Reply #1 on: July 05, 2012, 08:48:17 PM »
Hmmm, I thought figured out why it didn't work. The format of the 2 approaches in the code is the same except one has a conditional argument. Not sure why I am not showing the syntax highlighting.

KewlToyZ

  • Guest
Re: 2013 Command line syntax highlighting?
« Reply #2 on: July 06, 2012, 02:09:35 PM »
What I have running is my duct drafting tools. For some reason the first Layer selection option works with the Syntax highlighting, but the second for the duct fitting selection doesn't offer syntax highlighting. I am debating on moving some of the routines out of the tool as separate entities just to reduce the confusion in it.
1st one that works:
Code - Auto/Visual Lisp: [Select]
  1. (defun MLay ()
  2.         (initget "M-HVAC-D,D M-HVAC-E,E M-HVAC-SUPP,S M-HVAC-RETN,R M-HVAC-OAIR,O M-HVAC-EXHS,EX") ; Set Keywords
  3.         (setq Ductlay (getkword "\n Select System Options [Demo/Existing/Supply/Return/Outside air/EXhaust] - <(S) Supply>:"))
  4.         (if (not (tblobjname "layer" ductlay))
  5.                 (progn
  6.                         (autoload "LRM" '("LRM"))
  7.                         (c:LRM)
  8.                 )
  9.                 (prompt "\n   Mechanical layers loaded! ....")
  10.         ) ;End If        
  11.         (setvar "clayer" ductlay)
  12.         (princ ductlay)
  13.         (princ ": layer set!!")
  14. ) ; End MLay
  15. ;(princ)
  16. (MLay)
  17.  

2nd one not offering the syntax highlighting:
Code - Auto/Visual Lisp: [Select]
  1. (defun ductfittings ()
  2.         (command "osmode" 567)
  3.         (command "polarang" 15)
  4.         (command "autosnap" 29)
  5.         (command "snapang" 0)
  6.         (command "cmdecho" 0)
  7.         (command "-units" "4" "16" "1" "2" "0" "N")
  8.         (command "cmdecho" 1)
  9.        
  10.         (initget "Duct,D Radius,R Elle,E Horizontaltr,H Concentrictr,C Offsettr,O rectTakeoff,T oValtakeoff,V Flex,F" )
  11.         (setq fitting (getkword "Duct Radius Elle Horizontaltr Concentrictr Offsettr rectTakeoff oValtakeoff Flex: <D = continue Duct>:"))
  12.         (cond
  13.                 ((= fitting "Duct") (continueduct))
  14.                 ((= fitting "Radius") (radius))
  15.                 ((= fitting "Elle") (elle))
  16.                 ((= fitting "Horizontaltr") (Horizontaltr))
  17.                 ((= fitting "Concentrictr") (Concentrictr))
  18.                 ((= fitting "Offsettr") (Offsettr))
  19.                 ((= fitting "rectTakeoff") (rectTakeoff))
  20.                 ((= fitting "oValtakeoff") (oValtakeoff))
  21.                 ((= fitting "Flex") (flex))
  22.         )      
  23.         (*error* "") ; restore variables
  24.         (princ "\n Osnaps returned. ductfittings..") ; -----------------------Return User Osmode Settings
  25. )
  26.  

I'll attach the routines. But for the most part, I can't see why the syntax highlighting isn't working?

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: 2013 Command line syntax highlighting?
« Reply #3 on: July 07, 2012, 05:03:30 AM »
You need to include the options in square brackets in the prompt, otherwise it won't show as options to choose. Note your first version has all the keywords listed in this form: "[Key1/Key1/.../Keyn]". The 2nd doesn't have these, so it's not shown as options at the command line.

BTW, some of the initget options don't need the extra ",#". E.g.  The intent of "Duct,D" is the same thing as "Duct". Though from the help, this only works when all the characters preceding the "," is uppercase. So you should try "DUCT,D" instead.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

KewlToyZ

  • Guest
Re: 2013 Command line syntax highlighting?
« Reply #4 on: July 09, 2012, 01:55:06 PM »
Thanks Irneb, much appreciated sir =)

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: 2013 Command line syntax highlighting?
« Reply #5 on: July 09, 2012, 04:40:49 PM »
Glad to help. So I take it you've got it sorted now?  :kewl:
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.