TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lee Mac on May 14, 2009, 08:08:52 AM

Title: ACET... functions
Post by: Lee Mac on May 14, 2009, 08:08:52 AM
I am aware that quite a few of these "ACET-"... functions exist, but have no idea what they do as most are not documented in the ACAD help files.

Does anyone know where I can find information on such functions?
Title: Re: ACET... functions
Post by: It's Alive! on May 14, 2009, 08:12:28 AM
I think those are for express tools,
I had always tried to stay away from those as they are not installed on some machines.
Title: Re: ACET... functions
Post by: ElpanovEvgeniy on May 14, 2009, 08:17:12 AM
AfraLisp.net (An Introduction to 'acetutil' Functions) (http://www.afralisp.net/lisp/acet-utils.htm)
Title: Re: ACET... functions
Post by: Lee Mac on May 14, 2009, 08:22:11 AM
Thanks guys,

I use them rarely, but just wanted to know what was available to me if I need it   :-)

Thanks for your time,

Lee
Title: Re: ACET... functions
Post by: Gliderider on May 14, 2009, 08:30:49 AM
Do a search on your computer for acetutil.chm (help file). If it's not there. I could get it to you.
Title: Re: ACET... functions
Post by: Lee Mac on May 14, 2009, 08:37:22 AM
I can't find that file Larry - but the link that ElpanovEvgeniy  provided is brillant :-)
Title: Re: ACET... functions
Post by: Gliderider on May 14, 2009, 08:50:46 AM
I think the link at Afralisp covers everything contained in the .chm file.
Title: Re: ACET... functions
Post by: MP on May 14, 2009, 09:41:32 AM
I had always tried to stay away from those as they are not installed on some machines.

this (http://www.theswamp.org/screens/mp/oh.gif)
Title: Re: ACET... functions
Post by: Matt__W on May 14, 2009, 09:49:04 AM
this (http://www.theswamp.org/screens/mp/oh.gif)
this blows??   :?
Title: Re: ACET... functions
Post by: MP on May 14, 2009, 09:50:23 AM
ditto | repeat | what she said ...
Title: Re: ACET... functions
Post by: Joe Burke on May 14, 2009, 10:04:59 AM
While I agree with the idea these functions should not be depended on, the fact they are typically installed since I'm not sure what version makes them compelling given no other chioce.

Example, the SwapText routine I posted recently makes good use of the acet-sys-shift-down function. Of course the routine checks for whether the function is available.

Just my two cents...
Title: Re: ACET... functions
Post by: MP on May 14, 2009, 10:21:26 AM
While I agree with the idea these functions should not be depended on, the fact they are typically installed since I'm not sure what version makes them compelling given no other chioce.

Speaking of "no other choice" did you dump the notion of rolling your own (http://www.theswamp.org/index.php?topic=19644.msg239545#msg239545) or using George Harrison's arx (http://www.theswamp.org/index.php?topic=19644.msg239517#msg239517)?
Title: Re: ACET... functions
Post by: Didge on May 14, 2009, 11:14:02 AM
Here's a comprehensive list of the ACET Functions, albeit dated from around 2008'ish.

For purposes of compatibility I also avoid using them, however I must admit, I can never resist the "ACET-PROGRESS" functions for a rather sexy progress bar.
Title: Re: ACET... functions
Post by: Joe Burke on May 14, 2009, 11:26:38 AM
While I agree with the idea these functions should not be depended on, the fact they are typically installed since I'm not sure what version makes them compelling given no other chioce.

Speaking of "no other choice" did you dump the notion of rolling your own (http://www.theswamp.org/index.php?topic=19644.msg239545#msg239545) or using George Harrison's arx (http://www.theswamp.org/index.php?topic=19644.msg239517#msg239517)?

Michael,

If I knew how to roll my own I would. I don't.

What I have is the ExpressTools option, and appently some ARX by George Harrison which you mentioned, and an ARX by Luis which does the same thing with the shift key. Given these choices, I'd rather depend on ET than have to include a separate ARX routine/file.

Joe
Title: Re: ACET... functions
Post by: Spike Wilbury on May 14, 2009, 11:41:09 AM
While I agree with the idea these functions should not be depended on, the fact they are typically installed since I'm not sure what version makes them compelling given no other chioce.

Speaking of "no other choice" did you dump the notion of rolling your own (http://www.theswamp.org/index.php?topic=19644.msg239545#msg239545) or using George Harrison's arx (http://www.theswamp.org/index.php?topic=19644.msg239517#msg239517)?

Michael,

If I knew how to roll my own I would. I don't.

What I have is the ExpressTools option, and appently some ARX by George Harrison which you mentioned, and an ARX by Luis which does the same thing with the shift key. Given these choices, I'd rather depend on ET than have to include a separate ARX routine/file.

Joe


Hola Jose.... George Harrison and me are the same persona :)

Edit: I just noticed that you don't want to have another dependency file for your program.
Title: Re: ACET... functions
Post by: Joe Burke on May 14, 2009, 12:35:27 PM
Luis my freind?

Is that you on the other end?

If so, I can't imagine why you would disguise your identity. It is after all your claim to fame.

Everyone within the programming community has benefitted by your generous wisdom.

Whatever drove you to this this point should be put in the shit can and ignored. Regardless of origin.

Regards
Joe
Title: Re: ACET... functions
Post by: cadplayer on February 01, 2013, 03:22:35 PM
There is some news I donīt know ? Have the same questions as Lee. No documentation what it means all acet... !
Title: Re: ACET... functions
Post by: Marc'Antonio Alessi on February 02, 2013, 03:12:11 AM
If we want to be precise, there are two ACET-... functions that are now embedded in AutoCAD:
ACET-LAYERP-MARK ACET-LAYERP-MODE

Exploring (atoms-family ..) in my versions 2013 Mechanical I found some things
I do not remember anything about.

Does anyone know anything?

Comando: !_MATTS_UTIL
#<SUBR @0000000028998930 <EXRXSUBR>>

Comando: !PRAGMA
#<SUBR @000000002899d458 PRAGMA>

Comando: !VL-INFP
#<SUBR @000000000b452b10 VL-INFP>

Comando: (VL-NANP 0)
nil
Title: Re: ACET... functions
Post by: irneb on February 02, 2013, 08:58:38 AM
Don't know of all those others, will have to investigate. From that vl-nanp's name I can only surmise it "should" have been something like a predicate to test if a value if Not-A-Number. But it seems to be broken - such predicates should not error out when they get other types of values in their parameters, especially if they're testing for something which "isn't".:
Code: [Select]
_$ (vl-nanp "1")
_$ (vl-nanp 0)
nil
_$ (vl-nanp t)
; error: bad argument type: numberp: T
_$ (vl-nanp 0.1)
nil_$ (vl-nanp (entlast))
_$ (vl-nanp '(1 2 3))
_$ (vl-nanp nil)
; error: bad argument type: numberp: nil
So sending a string / ename / list returns nothing, sending T / nil errors out. IMO less than useful!

Edit: Anyhow, if that is the correct reason behind the vl-nanp function it's quite simple to roll your own:
Code - Auto/Visual Lisp: [Select]
  1. (defun nan-p (arg) (not (member (type arg) '(Int Real))))

PPS: And anyway, why not use the built-in numberp in any case? Makes it even easier:
Code - Auto/Visual Lisp: [Select]
  1. (defun nan-p (arg) (not (numberp arg)))
Title: Re: ACET... functions
Post by: irneb on February 02, 2013, 09:15:14 AM
As for the _MATTS_UTIL, it seems to be something which tests if an attribute is a multi-line attrib. Returns T if sent the ename of a MAttrib, else returns nil.

Will do some more googling and/or hacking to see if I can get something on the rest of them.
Title: Re: ACET... functions
Post by: Lee Mac on February 02, 2013, 09:19:02 AM
vl-infp tests for reals exceeding the maxmimum storable value, e.g. for 32-bit Doubles:

Code - Auto/Visual Lisp: [Select]
  1. _$ (vl-infp 1.7e308)
  2. nil
  3. _$ (vl-infp 1.8e308)
  4. T

pragma may be used to protect / unprotect symbols - there are many examples of its use if you search the forum.

Title: Re: ACET... functions
Post by: irneb on February 02, 2013, 09:21:37 AM
You're correct, just found this: http://www.cadtutor.net/forum/showthread.php?61972-Oldie-but-a-Goodie-PRAGMA- (http://www.cadtutor.net/forum/showthread.php?61972-Oldie-but-a-Goodie-PRAGMA-)!
Thanks to RenderMan for that bit of info  :kewl:

So the vl-infp means: predicate on infinity  ;) . Thanks, was getting round to it I guess.
Title: Re: ACET... functions
Post by: Lee Mac on February 02, 2013, 09:22:10 AM
Another related thread:
http://www.theswamp.org/index.php?topic=40477 (http://www.theswamp.org/index.php?topic=40477)
Title: Re: ACET... functions
Post by: BlackBox on February 02, 2013, 09:34:18 AM
You're correct, just found this: http://www.cadtutor.net/forum/showthread.php?61972-Oldie-but-a-Goodie-PRAGMA- (http://www.cadtutor.net/forum/showthread.php?61972-Oldie-but-a-Goodie-PRAGMA-)!
Thanks to RenderMan for that bit of info  :kewl:

Cheers dude *Tips hat*
Title: Re: ACET... functions
Post by: hmspe on February 02, 2013, 03:31:27 PM
_MATTS_UTIL may do a bit more than that.  It is used in burst.lsp:
Code: [Select]
      (if (_MATTS_UTIL ANAME)
         (progn
            ; Multiple Line Text Attributes (MATTS) -
            ; make an MTEXT entity from the MATTS data
            (_MATTS_UTIL ANAME 1)
         )
Title: Re: ACET... functions
Post by: owenwengerd on February 02, 2013, 04:53:02 PM
PPS: And anyway, why not use the built-in numberp in any case?

Your proposed alternatives to (vl-nanp) would not be the same thing. I'm not familiar with the (vl-nanp) function, but assuming its name implies its purpose, then it should only accept a floating point number as its argument, and it should only return T when that number is a NaN, which is a very specific floating point value that represents an otherwise unrepresentable numerical result of a calculation.
Title: Re: ACET... functions
Post by: Lee Mac on February 02, 2013, 06:43:57 PM
The vl-nanp function seems to be redundant since operations such as (/ 0 0), (sqrt -1) or (expt 0 0) in order to produce a NaN result will cause an error during evaluation so the result cannot be tested.
Title: Re: ACET... functions
Post by: owenwengerd on February 02, 2013, 10:18:21 PM
Lee, it may not be possible to produce a NaN from built-in functions, but I expect that non-built-in functions can return NaN (also, I don't think dividing by zero produces a NaN).
Title: Re: ACET... functions
Post by: HasanCAD on February 03, 2013, 12:39:33 AM
acetutil.help
http://www.findthatzipfile.com/search-8657303-hZIP/winrar-winzip-download-acetutil.zip.htm
Title: Re: ACET... functions
Post by: Lee Mac on February 03, 2013, 08:40:13 AM
also, I don't think dividing by zero produces a NaN

Dividing 0/0 should since as far as I know all indeterminate forms should return a NaN result.
Title: Re: ACET... functions
Post by: irneb on February 03, 2013, 09:36:48 AM
Sorry, I'm not the mathematician you guys are - usually I've forgotten what I learnt around 15 years ago while doing Maths at university. A situation of use it or loose it  :lmao:

Anyhow, it does seem as if Lee's on the money with 0/0: http://en.wikipedia.org/wiki/NaN (Oh why didn't I go look there before jumping the gun? :pissed: )

While divide by zero is defined as infinity (negative / positive), the 0/0 is a special case which is undefined. Thus it should be classed as "Not a Number".

Anyhow, in strictly AutoLisp code it's probably impossible to get to a NaN "number". At least without errors. Might be possible through some other external subroutines though. It seems even the CL hyperspec doesn't define such a predicate, though there is a sys:float-nan-p for some implementations defined as an extension function.