+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 21 to 29 of 29
  1. #21
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    837

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by lido View Post
    Sorry mr. ronjonp for wasting your time.
    Aggression cannot, under any circumstances, solve none problem!
    You did not waste my time...

  2. #22
    Forum Newbie lido's Avatar
    Computer Details
    lido's Computer Details
    Operating System:
    Windows 10 x64
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2005
    Join Date
    Jan 2017
    Posts
    9

    Default

    Quote Originally Posted by hanhphuc View Post
    Just test only..
    Code:
    ;At this level we can list out  
    (vl-registry-descendents  (strcat "HKEY_LOCAL_MACHINE\\"
    		 (vlax-product-key)
    		 "\\Applications\\")
      )
    
    
    ;but why this level doesn't work ???
    (vl-registry-descendents
      (strcat "HKEY_LOCAL_MACHINE\\"
    	  (vlax-product-key)
    	  "\\Applications\\"
    	  "AcEAttEdit"
    	  "\\Commands"
    	  ) 
      )
    another approach
    Code:
    (defun foo (app cmd)
      (and (setq app (findfile app))
           (vl-registry-read
    	 (strcat "HKEY_LOCAL_MACHINE\\"
    		 (vlax-product-key)
    		 "\\Applications\\"
    		 (vl-filename-base app)
    		 "\\Commands")
    		 (strcase cmd )
    		 ) 
    	 
           ) 
      )
    Code:
    _$ (foo "AcEAttEdit.arx" "EATTEDIT")
    T
    Thank you hanhphuc for your replay.
    Your first snippet returns a list containing the loaded applications. Not at all built-in commands. So, your second snippet return nil for any (?) built-in command.

  3. #23
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    655

    Default

    Quote Originally Posted by lido View Post
    Thank you hanhphuc for your replay.
    Your first snippet returns a list containing the loaded applications. Not at all built-in commands. So, your second snippet return nil for any (?) built-in command.
    yes that's the problem, if we could get the commands descendent list then we could collect all the command, but it failed.

    That's why I tried another predicate sub (foo app ac cmd) ;edited post#20
    but this method is not user friendly unless you know the app & name or (app list by vlookup or assoc)
    app="AcTable.arx" name="AcadTable"

    example:
    Code:
    (foo "AcTable.arx" "AcadTable" "TINSERT")
    IMO Roy043 has offered the best solution
    Last edited by hanhphuc; 12th Apr 2018 at 09:34 pm. Reason: the best deserves the smiley
    _$ ( apply 'equal "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" )
    ; error: too many arguments

  4. #24
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    963

    Default

    Quote Originally Posted by Roy_043 View Post
    To my knowledge there is no way to obtain a list of command names via Lisp code.

    For _eattedit and other commands that require user input something like this should work (on most CAD platforms I believe):
    Code:
    (defun CommandAvailable_P (cmd / ret)
      
    )
    Smart one Roy!

  5. #25
    Super Member
    Computer Details
    ronjonp's Computer Details
    Operating System:
    Windows 10
    Using
    AutoCAD 2018
    Join Date
    Apr 2009
    Location
    Colorado
    Posts
    837

    Default

    Quote Originally Posted by rlx View Post
    Smart one Roy!
    Agreed .. nice job.

  6. #26
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    655

    Default

    i think i missed something , i fixed here

    Code:
    (defun appcom ( / key l lst )
    ;hanhphuc 13.04.2018
      (setq key (strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key) "\\Applications\\"))
      (cdr (acad_strlsort
    	 (apply 'append
    		(mapcar ''((app)
    			   (vl-registry-descendents
    			    (strcat key app "\\Commands")
    			    app
    			    )
    			   )
    			(vl-registry-descendents
    			  key
    			  )
    			)
    		)
    	 )
           )
      )
    384 arx commands @ ac2007
    Code:
    ("-3DCONFIG"
      "-AecDwgUnits"     "-AecExportToAutoCAD"		   "-ARCHIVE"	      "-BEDIT"		 "-BVHIDE"
      "-BVSHOW"	     "-BVSTATE"		"-COPYTOLAYER"	   "-DIMSTYLE"	      "-DWFADJUST"	 "-DWFATTACH"
      "-EATTEXT"	     "-ETRANSMIT"	"-FIELD"	   "-HYPERLINK"	      "-IMAGE"		 "-IMAGEADJUST"
      "-INTERFERE"	     "-LAYDEL"		"-LAYMCH"	   "-LAYMRG"	      "-MTEXT"		 "-OPENSHEETSET"
      "-PLOTSTAMP"	     "-PUBLISH"		"-REFEDIT"	   "-SHADEMODE"	      "-TABLE"		 "-UNITS"
      "-UPDATEFIELD"     "-VBALOAD"		"-VBARUN"	   "+DSETTINGS"	      "+PUBLISH"	 "3DALIGN"
      "3DCLIP"	     "3DCONFIG"		"3DCORBIT"	   "3DDISTANCE"	      "3DDWF"		 "3DDWFPUBLISH"
      "3DFLY"	     "3DFORBIT"		"3DORBIT"	   "3DORBITCTR"	      "3DORBITTRANSPARENT"
      "3DPAN"	     "3DPANTRANSPARENT"	"3DSIN"		   "3DSWIVEL"	      "3DSWIVELTRANSPARENT"
      "3DWALK"	     "3DZOOM"		"3DZOOMTRANSPARENT"		      "ACAD_INTERNAL_CELLSELECT"
      "ACAD_INTERNAL_REPEATCELLEDIT"	"ACADBLOCKDIALOG"  "ACADWBLOCKDIALOG" "adc"		 "adcclose"
      "adccustomnavigate"			"adcenter"	   "adcnavigate"      "AecDisplayManagerConfigsSelection"
      "AecFileOpenMessage"			"AecFileSaveMessage"		      "AecObjectCopyMessage"
      "AecObjRelDump"    "AecObjRelShow"	"AecObjRelUpdate"  "AecPostDxfinFix"  "AecSetXrefConfig" "AecVersion"
      "AIDIMFLIPARROW"   "AIDIMPREC"	"AIDIMSTYLE"	   "AIDIMTEXTMOVE"    "ALIGN"		 "ANIPATH"
      "APPLOAD"	     "ARCHIVE"		"ARCTEXT"	   "ARRAY"	      "ASSIST"		 "ASSISTCLOSE"
      "ATEXT"	     "ATTACHURL"	"ATTEDIT"	   "ATTSYNC"	      "BACTION"		 "BACTIONSET"
      "BACTIONTOOL"	     "BASSOCIATE"	"BATTMAN"	   "BATTORDER"	      "BAUTHORPALETTE"	 "BAUTHORPALETTECLOSE"
      "BCLOSE"	     "BCYCLEORDER"	"BEDIT"		   "BGPLOTRECEIVE"    "BGRIPSET"	 "BLOCKICON"
      "BlookupTable"     "BMAKE"		"BMOD"		   "BPARAMETER"	      "BROWSER"		 "BROWSER2"
      "BSAVE"	     "BSAVEAS"		"BVHIDE"	   "BVSHOW"	      "BVSTATE"		 "cal"
      "CAMERA"	     "CHECKSTANDARDS"	"CHSPACE"	   "CLASSICIMAGE"     "content"		 "CONVERTCTB"
      "CONVERTOLDLIGHTS" "CONVERTOLDMATERIALS"		   "CONVERTPSTYLES"   "COPYTOLAYER"	 "cui"
      "cuiexport"	     "cuiimport"	"DASHBOARD"	   "DASHBOARDCLOSE"   "DBCCONFIGURE"	 "DBCCONNECT"
      "DBCDEFINELLT"     "DBCDEFINELT"	"DBCDELETELABELS"  "DBCDELETELINKS"   "DBCDELETELLT"	 "DBCDELETELT"
      "DBCDELETEQRY"     "DBCDISCONNECT"	"DBCEDITLINKEDTABLE"		      "DBCEDITLLT"	 "DBCEDITLT"
      "DBCEDITQRY"	     "DBCEDITTABLE"	"DBCEXECUTEQRY"	   "DBCEXPORTLINKS"   "DBCEXPORTQS"	 "DBCEXPORTTS"
      "DBCHIDELABELS"    "DBCIMPORTQRY"	"DBCIMPORTQS"	   "DBCIMPORTTS"      "DBCLINKCONVERSION"
      "DBCLINKMANAGER"   "DBCNEWQRYLT"	"DBCNEWQRYTABLE"   "DBCONNECT"	      "DBCPROPSLBLT"	 "DBCPROPSLT"
      "DBCRELOADLABELS"  "DBCSELECTLINKS"	"DBCSHOWLABELS"	   "DBCSYNC"	      "DBCVIEWLINKEDTABLE"
      "DBCVIEWTABLE"     "DDATTE"		"DDIM"		   "DDINSERT"	      "DDPLOTSTAMP"	 "DDPTYPE"
      "DDUNITS"	     "DDVPOINT"		"DETACHURL"	   "DIM"	      "DIM1"		 "DIMALIGNED"
      "DIMANGULAR"	     "DIMARC"		"DIMBASELINE"	   "DIMCENTER"	      "DIMCONTINUE"	 "DIMDIAMETER"
      "DIMDISASSOCIATE"  "DIMEDIT"		"DIMEX"		   "DIMHORIZONTAL"    "DIMIM"		 "DIMJOGGED"
      "DIMLINEAR"	     "DIMORDINATE"	"DIMOVERRIDE"	   "DIMRADIUS"	      "DIMREASSOCIATE"	 "DIMREGEN"
      "DIMROTATED"	     "DIMSTYLE"		"DIMTEDIT"	   "DIMVERTICAL"      "DISTANTLIGHT"	 "DRAWINGRECOVERY"
      "DRAWINGRECOVERYHIDE"			"DRAWORDER"	   "DSETTINGS"	      "DWFADJUST"	 "DWFATTACH"
      "DWFCLIP"	     "DWGPROPS"		"EATTEDIT"	   "EATTEXT"	      "EATTEXTEDIT"	 "EATTEXTUPDATE"
      "EPLOTEXT"	     "ETRANSMIT"	"ExacReload"	   "ExternalReferences"
      "ExternalReferencesClose"		"FIELD"		   "FILTER"	      "FIND"		 "FLATSHOT"
      "GEOGRAPHICLOCATION"			"HELIX"		   "HIDE"	      "HYPERLINK"	 "HYPERLINKBACK"
      "HYPERLINKFWD"     "HYPERLINKOPEN"	"HYPERLINKOPTIONS" "HYPERLINKSTOP"    "IMAGE"		 "IMAGEADJUST"
      "IMAGEATTACH"	     "IMAGECLIP"	"IMAGEFRAME"	   "IMAGEQUALITY"     "INTERFERE"	 "INTERNALTABLEDIT"
      "JOGSECTION"	     "JUSTIFYTEXT"	"LAYCUR"	   "LAYDEL"	      "LAYER"		 "LAYERP"
      "LAYERPMODE"	     "LAYFRZ"		"LAYISO"	   "LAYLCK"	      "LAYMCH"		 "LAYMRG"
      "LAYOFF"	     "LAYON"		"LAYTHW"	   "LAYTRANS"	      "LAYULK"		 "LAYUNISO"
      "LAYVPI"	     "LAYWALK"		"LEADER"	   "LIGHT"	      "LIGHTLIST"	 "LIGHTLISTCLOSE"
      "LIVESECTION"	     "MARKUP"		"MARKUPCLOSE"	   "MATCHCELL"	      "MATCHPROP"	 "MATERIALASSIGN"
      "MATERIALATTACH"   "MATERIALMAP"	"MATERIALS"	   "MATERIALSCLOSE"   "MIRROR3D"	 "MLEDIT"
      "MLSTYLE"	     "MOCORO"		"MOVEBAK"	   "MTEDIT"	      "MTEXT"		 "MTPROP"
      "NETLOAD"	     "NEWSHEETSET"	"NEWVIEW"	   "OLECONVERT"	      "OLEOPEN"		 "OLERESET"
      "OLESCALE"	     "OPENDWFMARKUP"	"OPENSHEETSET"	   "PAINTER"	      "PAINTPROP"	 "PASTEASHYPERLINK"
      "PLOTSTAMP"	     "POINTLIGHT"	"PPGETACADINPUT"   "PROPERTIES"	      "PROPERTIESCLOSE"	 "PROPULATE"
      "PUBLISH"	     "PUBLISHTOWEB"	"PURGE"		   "qcclose"	      "QDIM"		 "QLATTACH"
      "QLATTACHSET"	     "QLDETACHSET"	"QLEADER"	   "QSELECT"	      "quickcalc"	 "RECTANG"
      "RECTANGLE"	     "REFCLOSE"		"REFEDIT"	   "REFSAVE"	      "REFSET"		 "RENDER"
      "RENDERCROP"	     "RENDERENVIRONMENT"		   "RENDERPRESETS"    "RENDERWIN"	 "RESETBLOCK"
      "REVCLOUD"	     "ROTATE3D"		"RPREF"		   "RPREFCLOSE"	      "RTEXT"		 "SAVEIMG"
      "ScaleListEdit"    "SCALETEXT"	"SECTIONPLANE"	   "SECURITYOPTIONS"  "SELECTURL"	 "Setidrophandler"
      "SHADE"	     "SHADEMODE"	"SHEETSET"	   "SHEETSETHIDE"     "SIGVALIDATE"	 "SOLDRAW"
      "SOLPROF"	     "SOLVIEW"		"SPACETRANS"	   "SPOTLIGHT"	      "STANDARDS"	 "SUNPROPERTIES"
      "SUNPROPERTIESCLOSE"			"SYSVDLG"	   "TABLE"	      "TABLEDIT"	 "TABLEEXPORT"
      "TABLESTYLE"	     "TaskBar"		"TEXTTOFRONT"	   "TINSERT"	      "TOLERANCE"	 "TOOLPALETTES"
      "TOOLPALETTESCLOSE"			"TRANSPARENCY"	   "TXT2MTXT"	      "UNITS"		 "UPDATEFIELD"
      "UPDATETHUMBSNOW"  "VBAIDE"		"VBALOAD"	   "VBAMAN"	      "VBANEW"		 "VBAPREF"
      "VBARUN"	     "VBASTMT"		"VBAUNLOAD"	   "VIEW"	      "VIEWPLOTDETAILS"	 "VISUALSTYLES"
      "VISUALSTYLESCLOSE"			"VPMAX"		   "VPMIN"	      "VTOPTIONS"	 "WALKFLYSETTINGS"
      "WHOHAS"	     "WIPEOUT"		"XOPEN"		   "XP"		      "XPLODE"
      )
    you can use vl-position , member etc..
    Code:
    (defun bar (cmd) (vl-some ''((x) (wcmatch (strcase x) (strcat (strcase cmd)"*"))) (appcom)))
    
    _$ (bar  "eattedit")
    T
    Last edited by hanhphuc; 13th Apr 2018 at 01:42 am. Reason: strcase
    _$ ( apply 'equal "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" )
    ; error: too many arguments

  7. #27
    Super Member
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2015
    Join Date
    Nov 2013
    Posts
    1,447

    Default

    Good job, hanhphuc!
    You impressed me one more time..

  8. #28
    Super Member rlx's Avatar
    Computer Details
    rlx's Computer Details
    Operating System:
    W10
    Computer:
    i74ghz/ssd500/2tbhdd
    Discipline
    Electrical
    rlx's Discipline Details
    Occupation
    electrical designer dragon
    Discipline
    Electrical
    Details
    I dont excel in anything but I rearly give up
    Using
    AutoCAD 2016
    Join Date
    Nov 2014
    Location
    Bergen op Zoom , Netherlands
    Posts
    963

    Default

    Noticed that vlax-product-key can contain an addition code so by removing it you get the result you want.


    Code:
    ; hanhphuc 13.04.2018
    (defun appcom ( / key pk i l lst )
      (if (setq i (vl-string-position (ascii ":") (setq pk (vlax-product-key)))) (setq pk (substr pk 1 i)))
      (setq key (strcat "HKEY_LOCAL_MACHINE\\" pk "\\Applications\\"))
      (cdr (acad_strlsort (apply 'append (mapcar ''((app) (vl-registry-descendents (strcat key app "\\Commands") app))(vl-registry-descendents key))))))
    this probably also would do the trick :
    Code:
    (vl-registry-descendents (strcat "HKEY_LOCAL_MACHINE\\" (if (setq i (vl-string-position (ascii ":") (setq pk (vlax-product-key)))) (substr pk 1 i) pk) "\\Applications\\"))
    Last edited by rlx; 16th Apr 2018 at 01:28 pm.

  9. #29
    Super Member hanhphuc's Avatar
    Using
    AutoCAD 2007
    Join Date
    Apr 2013
    Location
    Happy Garden
    Posts
    655

    Default

    Registered forum members do not see this ad.

    @grrr thanks but it was VL trick respond "OP's topic - list the commands" not worth flettery but what MP's listing code was really impressed!!

    After all Roy's solution is more relevant as it met "KISS" principle

    @rlx IMO registry path product-key maybe varies due to different version ,thanks anyway
    Code:
    (defun appcom ( / key l lst )  ;<-- the l lst variables unused can be removed.
    The reason was initially using foreach later changed to mapcar...
    _$ ( apply 'equal "hp" "happy" "hạnh phúc" "ハッピー" "幸福" "행복" )
    ; error: too many arguments

Similar Threads

  1. How to Getvar from List Command Autolisp..?
    By GopinadhGvs in forum AutoCAD 2D Drafting, Object Properties & Interface
    Replies: 4
    Last Post: 10th Apr 2015, 02:40 pm
  2. How to utilize built-in Rotate command with SelectionSet?
    By Alex_AMF in forum .NET, ObjectARX & VBA
    Replies: 7
    Last Post: 3rd Dec 2014, 04:08 pm
  3. Is it possible to add a button/icon for an AutoLISP command to AutoCAD?
    By jjatho in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 3rd Jul 2013, 08:02 am
  4. Tutorial: Create a custom command for AutoCAD using AutoLISP
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 16th Jul 2012, 08:50 pm
  5. Command List Updated for AutoCAD R12 through AutoCAD 2009
    By HyperPics in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 18th Jul 2008, 03:30 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts