Author Topic: AutoLisp help  (Read 3052 times)

0 Members and 1 Guest are viewing this topic.

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
AutoLisp help
« on: December 09, 2021, 09:45:07 AM »
The help for AutoLisp has always been a bit vague/off/lacking in sections (COND for example). If you could change any AutoLisp help section which one would you change--and what would you add/change?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: AutoLisp help
« Reply #1 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
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Rod

  • Newt
  • Posts: 185
Re: AutoLisp help
« Reply #2 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
"All models are wrong, some models are useful" - George Box

BIGAL

  • Swamp Rat
  • Posts: 1407
  • 40 + years of using Autocad
Re: AutoLisp help
« Reply #3 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"))
A man who never made a mistake never made anything

Rod

  • Newt
  • Posts: 185
Re: AutoLisp help
« Reply #4 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.
"All models are wrong, some models are useful" - George Box

baitang36

  • Bull Frog
  • Posts: 213
Re: AutoLisp help
« Reply #5 on: December 16, 2021, 08:46:04 AM »
Add reading and writing methods of binary files

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: AutoLisp help
« Reply #6 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?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

baitang36

  • Bull Frog
  • Posts: 213
Re: AutoLisp help
« Reply #7 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"

JohnK

  • Administrator
  • Seagull
  • Posts: 10623
Re: AutoLisp help
« Reply #8 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?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

baitang36

  • Bull Frog
  • Posts: 213
Re: AutoLisp help
« Reply #9 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

domenicomaria

  • Swamp Rat
  • Posts: 724
Re: AutoLisp help
« Reply #10 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:


baitang36

  • Bull Frog
  • Posts: 213
Re: AutoLisp help
« Reply #11 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
« Last Edit: December 19, 2021, 09:48:07 AM by baitang36 »

domenicomaria

  • Swamp Rat
  • Posts: 724
Re: AutoLisp help
« Reply #12 on: December 19, 2021, 10:37:05 AM »
. . . while BricsCAD . . .

baitang36

  • Bull Frog
  • Posts: 213
Re: AutoLisp help
« Reply #13 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

domenicomaria

  • Swamp Rat
  • Posts: 724
Re: AutoLisp help
« Reply #14 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

baitang36

  • Bull Frog
  • Posts: 213
Re: AutoLisp help
« Reply #15 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.

baitang36

  • Bull Frog
  • Posts: 213
Re: AutoLisp help
« Reply #16 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.
« Last Edit: December 20, 2021, 09:58:28 PM by baitang36 »