Author Topic: Who has the usage of these ads functions?  (Read 1693 times)

0 Members and 1 Guest are viewing this topic.

baitang36

  • Bull Frog
  • Posts: 213
Who has the usage of these ads functions?
« on: November 20, 2021, 02:43:16 AM »
There is an old thing called ads, which is the C language development tool in AutoCAD 11.0 to 14.0.
 Later, with ObjectARX, ads was eliminated. Many ads functions have been eliminated, but some functions continue to be used by Acad.
For example, ads-cmd 
command  in LSP become ads-cmd at compile time.
Who has the usage of these ads functions?
 "ads-fail"
"ads-retstr"
"ads-post-cmd"
"ads-retint"
 "ads-retreal"
 "ads-retpoint"
 "ads-retnil"
"ads-rett"

The usage of these reserved functions can be executed after loading the following code
Then it can be used like the normal LISP function.
For example: (ads-fail "this is a test")


Code - Auto/Visual Lisp: [Select]
  1. ;; Activate a system retention function Author: tryhi sea
  2. (defun try-load-hide-fun (fun / dat file fo len)
  3.         (setq len(+ (* 2(strlen fun))28))
  4.         (setq file (vl-filename-mktemp "tryhi.fas"))
  5.         (setq dat
  6.                 (append
  7.                         '(266 70 65 83 52 45 70 73 76 69 32 59 98 121 58 116 114
  8.                                  121 104 105 32 13 266 49 13 266 49 32 36 32 36 13 266)
  9.                         (vl-string->list (itoa len))
  10.                         '(32 52 32 36 20 1 1 1 256 219)
  11.                         (vl-string->list fun)
  12.                         '(256 256 214)
  13.                         (vl-string->list fun)
  14.                         '(256 256 1 67 256 256 2 256 266 266 131 1 256 160 134 256 256 1 22 36 59 98 121 58 180 243 186 163)
  15.                 )
  16.         )
  17.         (setq fo (open file "w"))
  18.         (foreach x dat (write-char x fo))
  19.         (close fo)
  20.         (load file)
  21.         (vl-file-delete file)
  22.         (eval(read fun))
  23. )
  24.  
  25.  
  26.  
  27. ;; Batch activation system hidden functions
  28. (defun c:tt (/ fun)
  29.         (setq fun
  30.                 (list
  31. "ads-fail"
  32. "ads-retstr"
  33. "ads-post-cmd"
  34. "ads-retint"
  35.  "ads-retreal"
  36.  "ads-retpoint"
  37.  "ads-retnil"
  38. "ads-rett"
  39.  "ads-retvoid"
  40.  "ads-printf"
  41.  "ads-regapp"
  42. "ads-vports"
  43.  "ads-getenv"
  44. "ads-setenv"
  45. "ads-getcfg"
  46. "ads-setcfg"
  47.  "ads-getsym"
  48.  "ads-putsym"
  49.  "ads-defun"
  50.  "ads-undef"
  51.  "ads-invoke"
  52.  "ads-arxloaded"
  53. "ads-arxload"
  54.  "ads-arxunload"
  55.  "ads-fnsplit"
  56. "ads-dictrename"
  57.  "ads-dictremove"
  58.  "ads-dictadd"
  59.  "ads-entmakex"
  60. "ads-retname"
  61. "ads-entgetx"
  62. "ads-entmake"
  63. "ads-entmod"
  64.  "ads-tblnext"
  65.  "ads-tblsearch"
  66.  "ads-namedobjdict"
  67.  "ads-tblobjname"
  68. "ads-dictsearch"
  69.  "ads-dictnext"
  70. "ads-help"
  71.  "ads-setfunhelp"
  72.  "ads-snvalid"
  73. "ads-getcname"
  74. "ads-menucmd"
  75.  "ads-textbox"
  76.  "ads-cmd"
  77.  "ads-cmd-pure"
  78.  "ads-findfile-multi"
  79. "ads-ssget"
  80.  "ads-ssnamex"
  81.  "ads-ssgetfirst"
  82.  "ads-sssetfirst"
  83.  "ads-setview"
  84.  "ads-tablet"
  85.                 )
  86.         )
  87.         (mapcar 'try-load-hide-fun fun);
  88. )
  89.  
  90.  
« Last Edit: November 21, 2021, 07:19:30 PM by baitang36 »

It's Alive!

  • Retired
  • Needs a day job
  • Posts: 8691
  • AKA Daniel
Re: Who has the usage of these ads functions?
« Reply #1 on: November 20, 2021, 03:44:15 AM »
They are mostly still in ObjectARX and in the documentation. Their prefix has changed, I.e. ads-cmd is now acedcmd, acedgetenv, acutprintf.
I think bricscad still can use and load sds/ads applications.

domenicomaria

  • Swamp Rat
  • Posts: 724
Re: Who has the usage of these ads functions?
« Reply #2 on: November 20, 2021, 03:15:34 PM »
ADS.H

baitang36

  • Bull Frog
  • Posts: 213

d2010

  • Bull Frog
  • Posts: 326
Re: Who has the usage of these ads functions?
« Reply #4 on: November 21, 2021, 06:56:37 AM »
--How to simulate ads_retint inside Vlisp?
Details=== (ads_retint 1978) -- the function set return value at integer and exit from current call-stacks?
Code: [Select]
"ads-retint"
 "ads-retreal"
 "ads-retpoint"
 "ads-retnil"
"ads-rett"
 "ads-retvoid"

ADS.H
thank you

--How to emulate ads_retpoint.cpp, inside Vlisp with VLisp-function/s not use C++?
(ads_retpoint (getvar "VIEWPORT"))
 :smitten:
« Last Edit: November 21, 2021, 07:08:41 AM by d2010 »

domenicomaria

  • Swamp Rat
  • Posts: 724
Re: Who has the usage of these ads functions?
« Reply #5 on: November 21, 2021, 09:23:02 AM »
Quote
--How to emulate ads_retpoint.cpp, inside Vlisp with VLisp-function/s not use C++?
(ads_retpoint (getvar "VIEWPORT"))
you have to put, simply, the variable that represents the point, at the end of the defun before closing latest paren.
The same is for NIL, T, INT, REAL . . .

(defun c:k ()
   (setq p '(1.1 2.2 3.3))
   p
)

K returns P

domenicomaria

  • Swamp Rat
  • Posts: 724
Re: Who has the usage of these ads functions?
« Reply #6 on: November 21, 2021, 09:54:58 AM »
(defun GET-POINT ( / p)
   (setq p (getpoint "\nenter a point :") )
   p
)

(defun c:GP ( / p)
   (setq p (GET-POINT) )
)


baitang36

  • Bull Frog
  • Posts: 213
Re: Who has the usage of these ads functions?
« Reply #7 on: November 21, 2021, 07:22:15 PM »
Command: TT



(#<SUBR @0e99fb38 ads-fail> #<SUBR @0e99fb28 ads-retstr> #<SUBR @0e99fb18 



ads-post-cmd> #<SUBR @0e99fb08 ads-retint> #<SUBR @0e99faf8 ads-retreal> #<SUBR 



@0e99fae8 ads-retpoint> #<SUBR @0e99fad8 ads-retnil> #<SUBR @0e99fac8 ads-rett> 



#<SUBR @0e99fab8 ads-retvoid> #<SUBR @0e99fa98 ads-printf> #<SUBR @0e99f9f8 



ads-regapp> #<SUBR @0e99f9e8 ads-vports> #<SUBR @0e99f9d8 ads-getenv> #<SUBR 



@0e99f9c8 ads-setenv> #<SUBR @0e99f9b8 ads-getcfg> #<SUBR @0e99f9a8 ads-setcfg> 



#<SUBR @0e99f968 ads-getsym> #<SUBR @0e99f958 ads-putsym> #<SUBR @0e99f928 



ads-defun> #<SUBR @0e99f918 ads-undef> #<SUBR @0e99f908 ads-invoke> #<SUBR 



@0e99f8f8 ads-arxloaded> #<SUBR @0e99f8e8 ads-arxload> #<SUBR @0e99f8d8 



ads-arxunload> #<SUBR @0e99f8c8 ads-fnsplit> #<SUBR @0e99e6e0 ads-dictrename> 



#<SUBR @0e99e6cc ads-dictremove> #<SUBR @0e99e6b8 ads-dictadd> #<SUBR @0e99f8b8 



ads-entmakex> #<SUBR @0e99f7a8 ads-retname> #<SUBR @0e99f758 ads-entgetx> 



#<SUBR @0e99f718 ads-entmake> #<SUBR @0e99f708 ads-entmod> #<SUBR @0e99f6f8 



ads-tblnext> #<SUBR @0e99f6e8 ads-tblsearch> #<SUBR @0e99e4d8 NAMEDOBJDICT> 



#<SUBR @0e99e4c4 TBLOBJNAME> #<SUBR @0e99f6d8 DICTSEARCH> #<SUBR @0e99f6c8 



DICTNEXT> #<SUBR @0e99f6b8 HELP> #<SUBR @0e99f6a8 SETFUNHELP> #<SUBR @0e99f698 



SNVALID> #<SUBR @0e99e4b0 GETCNAME> #<SUBR @0e99f5e8 MENUCMD> #<SUBR @0e99f5d8 



ads-textbox> #<SUBR @0e99f438 ads-cmd> #<SUBR @0e99f428 ads-cmd-pure> #<SUBR 



@0e99f418 ads-findfile-multi> #<SUBR @0e99f3d8 ads-ssget> #<SUBR @0e99f3c8 



ads-ssnamex> #<SUBR @0e99f3b8 ads-ssgetfirst> #<SUBR @0e99f3a8 SSSETFIRST> 



#<SUBR @0e99e30c ads-setview> #<SUBR @0e99e2f8 ads-tablet>)



Command:



Command: (ads-fail "hello")



Application error: Hello



nil
« Last Edit: November 21, 2021, 07:25:32 PM by baitang36 »