Writhing LISP programs for both 2002 and 2005 ?

Discussion of MicroSurvey CAD related issues and questions.

Moderators: Brian Sloman, Jason Poitras, James Johnston

Post Reply
robert_s
Posts: 10
Joined: Fri Oct 15, 2004 6:42 pm

Writhing LISP programs for both 2002 and 2005 ?

Post by robert_s » Tue Nov 29, 2005 12:00 pm

I want to write LISP program working on both 2002 and 2005
MSCAD. Some functions such as initget require different parameters in both versions. The following code does the job but it is not very elegant solution. Is there better way of doing it? Is there a variable which would allow me to retrieve MSCAD version?

(cond
((getvar "FCVERSION") (initget 256 "RR LL RL LR")) ; 2002 MSCAD
((getvar "ICADVER") (initget 2 "RR LL RL LR")) ; 2005 MSCAD
(T (initget 256 "RR LL RL LR"))
)

(setq theLine (getkword))

User avatar
Darcy Detlor
Site Admin
Posts: 205
Joined: Tue Oct 29, 2002 10:14 am
Location: West Kelowna, BC
Contact:

Post by Darcy Detlor » Tue Nov 29, 2005 1:17 pm

There is no MSCAD lisp version, but your method is about as short as you are going to get even if there was. You could use an if() statement and just check one of the variables instead of both.

Your solution is a good one, especially if you put it in a library function that can be called from any lisp routine.
Darcy Detlor,
President,
MicroSurvey Software Inc.
darcy.detlor@microsurvey.com

Post Reply