newbie question

newbie question

qkakkel
Contributor Contributor
1,172 Views
24 Replies
Message 1 of 25

newbie question

qkakkel
Contributor
Contributor

I am still a newbie in lisp code so here is my question.

I have a DCL file and I need the lisp code to get it to work, (I don't know how to write the lisp code).

In  the DCL file there is a width , height , and length .

I only attach a part of the DCL file.

I want the lisp code that draws the lines in a autocad drawing.

If somebody can write the code for me .

 

Forgive me if I mispell some words I not live in a Englisch speaking country.

 

0 Likes
1,173 Views
24 Replies
Replies (24)
Message 2 of 25

paullimapa
Mentor
Mentor

explorer the tutorial on this website:

https://www.afralisp.net/dialog-control-language/


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 3 of 25

qkakkel
Contributor
Contributor

I already explored the site  afralisp and also  the site of Jeffrey Sanders  and I read the book of Roy Harkow and the book of Lee Ambrosius.

Making DCL file is easy I have no problems with it only lisp is giving me a hard time.

0 Likes
Message 4 of 25

paullimapa
Mentor
Mentor

I would say go back and go through each lesson very carefully executing all the examples exactly as you see them. Because even your dcl code is incomplete regardless of the lisp code. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 25

qkakkel
Contributor
Contributor

I already did it several times and some are working and some are not working , and when this happens I give up hope.

 

0 Likes
Message 6 of 25

paullimapa
Mentor
Mentor

upload one of the lisp code and dcl files here from those examples that is not working for you. What is the error message. Do a screen capture if needed to describe what you’re seeing. That would be a great start to learn from. 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 7 of 25

Sea-Haven
Mentor
Mentor

 Ok to take the pain away, I wrote this plus more, as library routines to do what your trying to do, it only takes a couple of lines of code to work.

 

 

(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq ans (AH:getvalsm (list "Enter values " "Lengte " 5 4 "100" "Breedte " 5 4 "100" "Hoogte" 5 4 "100")))

(setq lengte (atof (nth 0 ans)) Breedte (atof (nth 1 ans)) Hoogte (atof (nth 2 ans)))

 

 You just need to save Multi getvals.lsp ina support path or change the (load "D:\\fullpath name\\Multi getvals") to include full path use "\\" for directories.

SeaHaven_0-1700619442267.png

A lot of us don't write a separate dcl but rather have the make a dcl as part of the lisp, using a write temp file look at attached.

 

Back to yours redid the dcl

 

  widhtlen : dialog {
  label = "Please enter values" ;
 : column {
 width = 25 ;
  : edit_box {   						 //define edit box
         key = "Len" ;   			                 //give it a label
         label = "Lengte :" ;  					 //give it a lenght
         mnemonic = "";
         edit_width = 20 ;  					 //30 characters
       }    							 //end edit box
    								 //end edit box
       : edit_box {  						 //define edit box
           key = "bred" ; 			  		 //give it a label
           label = "Breedte :" ; 			         //give it a width
           mnemonic = "";
           edit_width = 20 ;  					 //30 characters
       } 							 //end edit box
   								  //end edit box
       : edit_box {  						 
           key = "hogt" ;  			 	         
           label = "Hoogte :" ;  				 
           mnemonic = "";
           edit_width = 20 ;  
        }
		}
spacer_1 ;
ok_cancel ; }
(defun c:lenwidht ( / )
(setq dcl_id (load_dialog "d:\\acadtemp\\temp.dcl"))
  (if (not (new_dialog "widhtlen" dcl_id))
    (exit)
  )
 (mode_tile "Len" 2)
(action_tile "len" "(setq Lengte (atof $value))")
(action_tile "bred" "(setq Breedte(atof $value))")
(action_tile "hogt" "(setq Hoogte (atof $value))")
(action_tile "accept" "(done_dialog)")
  (action_tile "cancel" "(done_dialog)")
  (start_dialog)
  (unload_dialog dcl_id)
(princ)
)

 

 

 

 

 

0 Likes
Message 8 of 25

qkakkel
Contributor
Contributor

A few months ago we had contact ,about the site of Jeffrey Sanders the were some lines off code ,you send me the right ones .

0 Likes
Message 9 of 25

paullimapa
Mentor
Mentor

the afralisp site is the way to go


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 10 of 25

qkakkel
Contributor
Contributor

Yesterday I forget to mention that I only need the 3 lines off code to get it work .

The rest of the code I already have .

And the DCL file I know that it is not complete but I did not copy it all.

0 Likes
Message 11 of 25

paullimapa
Mentor
Mentor

best for you to post the entire lisp & dcl code for community to help you troubleshoot. Otherwise we're just guessing what is needed.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 12 of 25

qkakkel
Contributor
Contributor

The code that I have so far is in Dutch.

0 Likes
Message 13 of 25

paullimapa
Mentor
Mentor

that's fine. I'm sure there are those who can read dutch in this forum that can help..just post it.


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 14 of 25

qkakkel
Contributor
Contributor
I rather don't want to post it on internet .
Because I want to make a program that not consist here in the Netherlands.
0 Likes
Message 15 of 25

paullimapa
Mentor
Mentor

then unfortunately, no one can help you


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 16 of 25

qkakkel
Contributor
Contributor
I want to make a program to calculate everything to build a coldstore , here in the Netherlands is not something like that.
That is why I try to make it.

0 Likes
Message 17 of 25

Sea-Haven
Mentor
Mentor

The multi getvals.lsp worked in Japanese version so Dutch should not be a problem. Did you look at the updated DCL I provided used your Dutch variable naming. Making custom DCL's takes practice. Like this.

SeaHaven_0-1700784733096.png

 

 

 

0 Likes
Message 18 of 25

qkakkel
Contributor
Contributor
Thanks for your reply , but it is not working on my pc or I am doing something wrong !
0 Likes
Message 19 of 25

john.uhden
Mentor
Mentor

That looks more like a window sash than a window frame.

<A non-architectural civil>

John F. Uhden

0 Likes
Message 20 of 25

john.uhden
Mentor
Mentor

That looks more like a window sash than a window frame.

[A non-architectural civil]

John F. Uhden

0 Likes