Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Work around to avoid .dcl files

10 REPLIES 10
Reply
Message 1 of 11
k57skye
927 Views, 10 Replies

Work around to avoid .dcl files

I am running autocad 2011 for mac to design sails. I was given a autolisp file that will automate the majority of the process, but it uses a .dcl file to input all the numbers. Unfortunately .dcl files are not support with the Mac version and therefore I am looking for any solutions. 

 

- Is there another way to input the information and therefore link the lsp file to something different?

- Is it easy to re-write the lisp file and input directly into that?

 

I am a newbie, but willing to put the hours in to learn... just dont know which direction to put those hours into. At the moment the time I am wasting researching how to make the .lsp program work, I could have hand drawn most of the sails anyway!

 

Any help would be greatly appreciated.

Tags (2)
10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: k57skye

attach the lisp file(s), as well as the dcl file(s) if you have them, perhaps from there we can see what your working with and see if there is a simple solution.

Message 3 of 11
k57skye
in reply to: Anonymous

Attached are the 2 files. Would be great if you can point me in the right direction.... if there is one.

 

Thanks

Message 4 of 11
pbejse
in reply to: k57skye


@k57skye wrote:

Attached are the 2 files. Would be great if you can point me in the right direction.... if there is one.

 

Thanks


The only workaround i can think of is usign a third party prgram like OpenDCL I believe they developed one for MAC

 

But not being able to work with Mac versions, I'm not use it'll work for you.

Message 5 of 11
k57skye
in reply to: pbejse

Thanks for that... but guess what... I dont think OpenDCL runs on Mac either!! Any other suggestions? Sounds like that would ave been the way.

 

 

 

Message 6 of 11
rkmcswain
in reply to: k57skye


@k57skye wrote:

I am running autocad 2011 for mac............. .dcl files are not support with the Mac........ Is there another way to input the information and therefore link the lsp file to something different?


Took a quick look at your lsp/dcl and although it would be messy due to the numerous fields, you could eliminate the dialog and accept input at the command line, or re-write it so that it accepts input from an ASCII file perhaps...?

R.K. McSwain     | CADpanacea | on twitter
Message 7 of 11
pbejse
in reply to: rkmcswain


rkmcswain wrote:


 

Took a quick look at your lsp/dcl and although it would be messy due to the numerous fields, you could eliminate the dialog and accept input at the command line, or re-write it so that it accepts input from an ASCII file perhaps...?


i guess that would be the most logical thing to do.

 

I could've sworn OpenDCL  gave-in to  numerous request from MAC users to enable their program to work on Acad Mac.

 

Anyhoo. sorry cant be of more help k57skye

Message 8 of 11
stevor
in reply to: k57skye

Without a pre-load of values for all these variables,

 someone must do some answering of getreals.

The DCL can avoid every single answer, if the values are preloaded,

 but that does not appear to be done anyway.

 

Usually, most of the variable's values are pre-defined,

which can be doen with some more code; and

even written to a file for strorage instead of 'hard' codeing.

 

This version seems to work here, XP, and

does not have pre-defined values; AND

uses 0 instead of Nil to bypass some creations.

 

S
Message 9 of 11
k57skye
in reply to: stevor

Stevor.... Not sure if this is exceptable forum behaviour... but I love you!!! Thank you so much! I dont really understand what you were saying, but it works perfect, and will save me literally hours of drawing.

 

If I could buy you some beers I would!

 

One final remaining question... is there anyway to undo an entry... If I put in an incorrect number, is it possible to go back to it? Anyway... this can easily be adjusted later, so doesn't really matter anyway..

 

Thank you so much once again!!!

 

 

Message 10 of 11
pbejse
in reply to: k57skye


@k57skye wrote:

 

One final remaining question... is there anyway to undo an entry... If I put in an incorrect number, is it possible to go back to it? Anyway... this can easily be adjusted later, so doesn't really matter anyway..

 

Thank you so much once again!!!

 

 


If you want to go down that path:

(defun c:test (/ dsl _strnum _val item dat_)
(defun _strnum  (val tl / p)
      (repeat (- tl val)
            (setq p (strcat " "
                            (if p p " ")))) p)
(defun Show (lst / i)
(setq i 0)(textscr)
  (foreach itm lst
    	(princ (strcat "\n"
		       (itoa (setq i (1+ i)))
		       (if (< i 10) "  " " ")
		       (strcat (car itm) (_strnum  (strlen (car itm)) 16))
		       (rtos (eval (read (cadr itm))) 2 2)
	       )
	))(princ))  
(setq _val (lambda (data) (set (read (cadr data))
		(if (setq def (eval (read (cadr data))))
		  	  def (progn (initget 7)
				(getreal (strcat "\n" (car data) ": ")))))))  
(foreach Var (setq  dsl
	  '(("Baseline" "bl") ("Boomstraight" "bs") ("Boomheight" "bh")
	    ("Topoffset" "to") ("Topoffposition" "tp")
	    ("Batten1" "b1") ("Batten2" "b2")  ("Batten3" "b3")
	    ("Batten4" "b4") ("Batten5" "b5")  ("Batten6" "b6")
	    ("Batten7" "b7") ("Batten8" "b8")
	    ("Bp1" "bp1")("Bp2" "bp2")("Bp3" "bp3")
	    ("Bp4" "bp4")("Bp5" "bp5")("Bp6" "bp6")
	    ("Bp7" "bp7")("Bp8" "bp8")
	    ("Luff1" "l1") ("Luff2" "l2")("Luff3" "l3")
	    ("Luff4" "l4")("Luff5" "l5")("Luff6" "l6")
	    ("Ln1" "ln1")("Ln2" "ln2")("Ln3" "ln3")
	    ("Ln4" "ln4")("Ln5" "ln5")("Ln6" "ln6")
	   )
	)
  (_val Var))
(Show dsl)
(while (setq item (getint "\nItem to change: "))
  		(if (< item 33)(progn 
      			(setq dat_ (nth (1- item) dsl))
     			(set (read (cadr (setq dat_ (nth (1- item) dsl)))) nil)
      			(_val dat_)(Show dsl)) (print "Invalid Item nos: "))
      			
    )
(princ "\n<<<<<< Your Program Here >>>>>>>>:")


  (princ)

 

The code will not  draw your lines, its just a demonstration

 

Try it

 

Message 11 of 11
stevor
in reply to: k57skye

Not sure what you mean.

A simple way is to run the routine again,

and change the valuess of the variables,

and create a new sail.

 

Wiht so many vars, it is, as RKM said: messy.

So perhaps if there are ony few

 that are likey need frequent revision,

then I, or we, would change the lsp to:

 

1. Option to bypass the entire var setting

once it is entered the first time, and then

provide a revision of the select vars.

 

2. Or, put the entire var setting outside

the main routine, eg, c:SAIL, as an  'exterior'  routine;

and put the revision of a few vars inside the main.

The routine to set all the vars could be named c:SailV, etc.

 

3. Or, you could have several exterior routines

 to change sets of vars.

 

The list format shown by Pbejse may be easier to visualize

each var, but takes a little longer to write code,

if you are trying it.

 

All that just for Varable settings.

Again, I would record the initial settings,

somewhere in the sail lisp code, or

in another file, like aSail.dat.

If this is the type of concern,

post a list of the values.

S

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost