TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: JohnK on December 09, 2021, 09:45:07 AM

Title: AutoLisp help
Post by: JohnK on December 09, 2021, 09:45:07 AM
The help for AutoLisp has always been a bit vague/off/lacking in sections (COND (https://www.theswamp.org/Sources/doc/avlisp/#cond) for example). If you could change any AutoLisp help section which one would you change--and what would you add/change?
Title: Re: AutoLisp help
Post by: JohnK on December 09, 2021, 04:33:32 PM
I'll add an easy one:

ASCII/CHR
I would add a decimal ASCII chart.
Code: [Select]
The decimal ASCII set:

    0 nul    1 soh    2 stx    3 etx    4 eot    5 enq    6 ack    7 bel
    8 bs     9 ht    10 nl    11 vt    12 np    13 cr    14 so    15 si
   16 dle   17 dc1   18 dc2   19 dc3   20 dc4   21 nak   22 syn   23 etb
   24 can   25 em    26 sub   27 esc   28 fs    29 gs    30 rs    31 us
   32 sp    33  !    34  "    35  #    36  $    37  %    38  &    39  '
   40  (    41  )    42  *    43  +    44  ,    45  -    46  .    47  /
   48  0    49  1    50  2    51  3    52  4    53  5    54  6    55  7
   56  8    57  9    58  :    59  ;    60  <    61  =    62  >    63  ?
   64  @    65  A    66  B    67  C    68  D    69  E    70  F    71  G
   72  H    73  I    74  J    75  K    76  L    77  M    78  N    79  O
   80  P    81  Q    82  R    83  S    84  T    85  U    86  V    87  W
   88  X    89  Y    90  Z    91  [    92  \    93  ]    94  ^    95  _
   96  `    97  a    98  b    99  c   100  d   101  e   102  f   103  g
  104  h   105  i   106  j   107  k   108  l   109  m   110  n   111  o
  112  p   113  q   114  r   115  s   116  t   117  u   118  v   119  w
  120  x   121  y   122  z   123  {   124  |   125  }   126  ~   127 del
Title: Re: AutoLisp help
Post by: Rod on December 09, 2021, 05:15:37 PM
I'm not sure about the help file, but a list of common error/mistakes to help beginners. I made these mistakes, the first people I taught lisp made the mistakes, Autodesk made these same mistakes in commands and express tools

When using (command "pedit" ... check the status of peditaccept system variable
When using (ssget "x" ... did you mean to include objects in paperspace
When passing a point to a (command ... do you mean to use osnaps

Could end up being quite a long list, could probably be a thread on its own.

Cheers, Rod
Title: Re: AutoLisp help
Post by: BIGAL on December 09, 2021, 10:34:37 PM
When using (ssget "x" ... did you mean to include objects in paperspace, this exists all ready.

(ssget "X" '(410 . "Modelspace"))
Title: Re: AutoLisp help
Post by: Rod on December 09, 2021, 11:16:35 PM
Yeah, and its a beginner mistake not to do it like that.
Sorry if I wasn't more clear.
Title: Re: AutoLisp help
Post by: baitang36 on December 16, 2021, 08:46:04 AM
Add reading and writing methods of binary files
Title: Re: AutoLisp help
Post by: JohnK on December 16, 2021, 09:10:40 AM
Add reading and writing methods of binary files
Interesting! ...why/when would you read/write binary with AutoLisp? Wouldn't you just use any of the other OS supported languages?
Title: Re: AutoLisp help
Post by: baitang36 on December 18, 2021, 10:03:55 AM
Add reading and writing methods of binary files
Interesting! ...why/when would you read/write binary with AutoLisp? Wouldn't you just use any of the other OS supported languages?
In fact, AutoLISP itself has the ability to read and write binary files, but Autodesk does not disclose these functions.
 For example, the function to read binary files is  "_read-nb"
Title: Re: AutoLisp help
Post by: JohnK on December 18, 2021, 12:28:56 PM
How do you use "_read-nb"?

But more importantly, why would you use it? I mean to ask: instead, should you use C, C++, C#, etc to read/write binary files?
Title: Re: AutoLisp help
Post by: baitang36 on December 19, 2021, 12:29:32 AM
How do you use "_read-nb"?

But more importantly, why would you use it? I mean to ask: instead, should you use C, C++, C#, etc to read/write binary files?
I don't want to use other languages. It's very slow to operate files in other languages, and the compatibility is not good. It is more convenient and faster to operate binary files directly with AutoLISP.

I have a way to turn unpublished reserved functions into normal functions
Title: Re: AutoLisp help
Post by: domenicomaria on December 19, 2021, 07:11:10 AM
Quote
I have a way to turn unpublished reserved functions into normal functions

and what is this way?  :whistling:

Title: Re: AutoLisp help
Post by: baitang36 on December 19, 2021, 09:43:22 AM
Quote
I have a way to turn unpublished reserved functions into normal functions

and what is this way?  :whistling:
load syz-bin.fas
(syz-read-bin num filehand)
function syz-read-bin is _read-nb
function syz-write-bin is _write-nb-str
Title: Re: AutoLisp help
Post by: domenicomaria on December 19, 2021, 10:37:05 AM
. . . while BricsCAD . . .
Title: Re: AutoLisp help
Post by: baitang36 on December 19, 2021, 08:17:23 PM
. . . while BricsCAD . . .
Can bricscad run Acad's Fas file? You can try the attachment syz-bin.fas
Title: Re: AutoLisp help
Post by: domenicomaria on December 19, 2021, 11:55:02 PM
Quote
Can bricscad run Acad's Fas file? You can try the attachment syz-bin.fas

https://forum.bricsys.com/discussion/8248
Title: Re: AutoLisp help
Post by: baitang36 on December 20, 2021, 07:54:42 AM
Quote
Can bricscad run Acad's Fas file? You can try the attachment syz-bin.fas

https://forum.bricsys.com/discussion/8248
Thank you
I read this page. BRICs can't load Fas and vlx. In fact, Fas can be decompiled into LSP and then loaded. Now there are mature decompilation tools.
Title: Re: AutoLisp help
Post by: baitang36 on December 20, 2021, 09:13:26 PM
Quote
Can bricscad run Acad's Fas file? You can try the attachment syz-bin.fas

https://forum.bricsys.com/discussion/8248

I developed Fas encryption tool, and my PFAS sells well. Many LISP programmers are using my tools to protect their source code.
Decompilation tool is developed by others. I study it to prevent it.