Google Groepen ondersteunt geen nieuwe Usenet-berichten of -abonnementen meer. Historische content blijft zichtbaar.

Help calling geomcalc from lisp

25 weergaven
Naar het eerste ongelezen bericht

Smeghead

ongelezen,
26 okt 1999, 03:00:0026-10-1999
aan
Hello Everyone,
I have a line in a lisp the uses the calculator.
(setq pt5 (c:cal
"plt(pt2,pt3,0.5)"))
If I manually load the "cal" before I run it, it works. If I don't I get
this
error;

.*** ERROR : too many arguments


So I put (arxload "c:/program files/ACAD2000/geomcal.arx") in the
acad2000.lsp
file to be sure it was loaded.
Now everytime I open another drawing I see "arxload failed" (because its
already
loaded). Can someone tell me the proper way to handle this?

Thanks

Randy

Eugene N. Kilmer

ongelezen,
26 okt 1999, 03:00:0026-10-1999
aan
Mr. Smeghead,

Personally, I would not rely upon the command line calculator. LISP is rich
with calculations within itself that should be sufficient for what you are
trying to do.

--
Eugene N. Kilmer
Owner/Mag Drafting


Smeghead

ongelezen,
26 okt 1999, 03:00:0026-10-1999
aan
Middle of two end points (mee). To find the center of a rectangle and place
a hole of proper size based on rectangle width and height. I did notice a
middle point of a line routine in the tutorial , utilities.lsp. I'll give it
a try, thanks.
Eugene N. Kilmer wrote in message <7v5dp5$e4...@adesknews2.autodesk.com>...

Alex Januszkiewicz

ongelezen,
26 okt 1999, 03:00:0026-10-1999
aan
There are many ways to avoid this crash. The quick and dirty woul be:

(arxload "c:/program files/ACAD2000/geomcal.arx" 1)

More proper would be checking, if c:cal is already loaded:

(if (/= (type c:cal) 'EXRXSUBR)
(progn
(setq res (arxload "c:/program files/ACAD2000/geomcal.arx" 1))
(if (= res 1)
(prompt "\nCouldn't load calculator arx")
)
)
)

--
Alex Januszkiewicz
Intelcad Systems and 911 DWG Recovery Services
<http://www.intelcad.com>
*Check out our DWF => DWG converter*
** New free ObjectARX downloads coming soon**

--

Smeghead <shie...@sgi.net> wrote in message
news:7v5dhd$e3...@adesknews2.autodesk.com...

Mark McDonough

ongelezen,
26 okt 1999, 03:00:0026-10-1999
aan
Hi "Smeghead",

I have nothing to contribute to the issue you raise, other than the fun of
saying "Hi Smeghead" which is your chosen newsgroup name, but which is
generally thought of as a rude insult, at least in the UK, and perhaps in
the USA, where we watch Red Dwarf and other British comedies rich in "smeg"
connotations.

Mark McDonough
mmcdo...@sasaki.com

Smeghead wrote in message <7v5dhd$e3...@adesknews2.autodesk.com>...

J.H Chung

ongelezen,
27 okt 1999, 03:00:0027-10-1999
aan
Hi, Smeghead
I'm using similar lisp routine and it works well.
Please see bellows.
I'm sure this is what you looking for.


;;;;;; Loading "geomcal.arx" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun Load_cal ( / file_dia)
(if (not cal)
(progn
(setq file_dia (getvar "filedia"))
(setvar "filedia" 0)
(if (not (findfile "geomcal.arx"))
(prompt "\n Not found 'geomcal.arx' and '_cal command will be not to
work.")
(progn
;(command "appload" "C:\Program Files\ACAD2000\SUPPORT\geomcal.arx")
(command "_arx" "Load" "geomcal.arx")
(setvar "filedia" file_dia)
) ) ) )
(princ)
)

;;;;;; _offset+'cal ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun C:offcal ( / Distanc)
(Load_cal)
(command "_offset")
(setq Distanc (cal))
(command Distanc)
(princ)
)


Smeghead 이(가) <7v5dhd$e3...@adesknews2.autodesk.com> 메시지에서
작성하였습니다...

Phil Kenewell

ongelezen,
27 okt 1999, 03:00:0027-10-1999
aan
"Smeghead",

You don't need to use the Geometry Calculator for such a simple AutoLISP
Calc:

(setq p3 (polar p1 (angle p1 p2) (/ (distance p1 p2) 2)))

OR:

(setq p3 (MapCar '(Lambda (x1 x2) (/ (+ x1 x2) 2)) p1 p2))

--
Phillip Kenewell
CAD Systems Technician
Air Gage Company
pken...@airgage.com
===================
> Not < a Member of the AutoDESK
Discussion Forum Moderator Program

Smeghead <shie...@sgi.net> wrote in message
news:7v5dhd$e3...@adesknews2.autodesk.com...

Mark E. Fretty

ongelezen,
27 okt 1999, 03:00:0027-10-1999
aan
Would this code be more efficient?

(if (not (member "geomcal.arx" (arx)))
(arxload "c:/program files/ACAD2000/geomcal.arx" "Couldn't load calculator
arx")
)

Alex Januszkiewicz wrote in message
<7v5hp3$e4...@adesknews2.autodesk.com>...


>There are many ways to avoid this crash. The quick and dirty woul be:
>
> (arxload "c:/program files/ACAD2000/geomcal.arx" 1)
>
>More proper would be checking, if c:cal is already loaded:
>
>(if (/= (type c:cal) 'EXRXSUBR)
> (progn
> (setq res (arxload "c:/program files/ACAD2000/geomcal.arx" 1))
> (if (= res 1)
> (prompt "\nCouldn't load calculator arx")
> )
> )
>)
>
>--
> Alex Januszkiewicz
>Intelcad Systems and 911 DWG Recovery Services
> <http://www.intelcad.com>
> *Check out our DWF => DWG converter*
>** New free ObjectARX downloads coming soon**
>
>
>
>--
>

Randy Benson

ongelezen,
27 okt 1999, 03:00:0027-10-1999
aan

Mark McDonough <anten...@aol.com> wrote in message
news:7v5mkm$e5...@adesknews2.autodesk.com...
> Hi "Smeghead",
>
> ...other than the fun of

> saying "Hi Smeghead" which is your chosen newsgroup name, but which is
> generally thought of as a rude insult, at least in the UK, and perhaps in
> the USA, where we watch Red Dwarf ...
>
i'm (being a transplanted Texican) unfamiliar with the term "smeg..."
_except_ as used on Red Dwarf, which i enjoy at least as much as
HitchHiker's Guide to the Universe; while we're drifting, i wonder if any of
our Russian readers can affirm whether the composer Moussorgsky's name has
the same general connotation as smeghead?
[a rumor i heard, and no offense intended -- he's one of my favorites, too.]

randy benson (in arabic, randy son-of-a-son).

Smeghead

ongelezen,
27 okt 1999, 03:00:0027-10-1999
aan
You guys fixed me up, thanks. I see that I don't need the calculator but I
was so used to using 'cal ; mee that thats the only way I could think.

Randy

Alex Januszkiewicz

ongelezen,
28 okt 1999, 03:00:0028-10-1999
aan
It probably would, but it would not print the message unless it's the last
statement in the lisp file.

I would say, it's rather a matter of preference then efficiency, as you
would need to load 10000 files to catch measurable difference (say 1 sec?)
I usually concentrate my efforts in areas, where significant improvements
can be achieved by proper coding (iterations would be one of them). I can
make my first shot a bit tighter:

(if (/= (type c:cal) 'EXRXSUBR)

(if (= 1 (arxload "c:/program files/ACAD2000/geomcal.arx" 1))


(prompt "\nCouldn't load calculator arx")
)
)

I admit: I'm careless about efficiency of these particular code fragments,
as long as they properly load the program and trap possible error.

--
Alex Januszkiewicz
Intelcad Systems and 911 DWG Recovery Services
<http://www.intelcad.com>
*Check out our DWF => DWG converter*
** New free ObjectARX downloads coming soon**

--

Mark E. Fretty <ma...@aerosys.net> wrote in message
news:7v7bqs$j0...@adesknews2.autodesk.com...

0 nieuwe berichten