Im stuck Please Help (DCL)

Im stuck Please Help (DCL)

Jonathan3891
Advisor Advisor
488 Views
2 Replies
Message 1 of 3

Im stuck Please Help (DCL)

Jonathan3891
Advisor
Advisor

I'm stuck and cant find a solution.

I'm writing a lisp w/ DCL that will draw tee supports. I've got the list to show up in my DCL, but when you select a steel size, its not setting any values that I've stored.

Right now I only have 2 steel sizes in the program to try and simplify it.

Can someone please point me in the right direction?

Some areas I'm sure aren't correct:

 

User Input not storing the value

 

 

      (set_tile "toselev" "000.000")
      (mode_tile "toselev" 0)
      (action_tile "toselev" "(setq TOSEL $value)")

 

 

Recalling Steel Sizes

 

 

    (if userclick
	(progn
	  (setq $COLSIZE$ (fix $COLSIZE$))
	  (setq $COLSIZE$ (nth $COLSIZE$ column))
	  (setq $BMSIZE$ (fix $BMSIZE$))
	  (setq $BMSIZE$ (nth $BMSIZE$ beam))
	  ) 
Setting Variables for Steel Sizes
 
 (defun info ()
	    
	     
	     ((= $COLSIZE$ "W5X19")
	     (SETQ COLDEPTH 5.13)
	     (SETQ COLFLGTHK 0.44)
	     (SETQ PLTDEPTH 0.75)
	     (SETQ PLTWIDTH 12.0)
	    )

Jonathan Norton
Blog | Linkedin
0 Likes
489 Views
2 Replies
Replies (2)
Message 2 of 3

paullimapa
Mentor
Mentor

First of all, your lisp code calls for a slide file with an embedded path of "i:/acad/lisp/tpole2.sld".  Since this is not included in your attachments, test loading the lisp routine will fail.

 

Second, for your action_tile statement, why did you include functions: (strcat & (progn ?

I would drop these out and just use:

(action_tile "accept" "(setq $COLSIZE$ (atof (get_tile \"column\")))(setq $BMSIZE$ (atof (get_tile \"beam\")))(done_dialog)(setq userclick1 T)")

 

Thirdly, you are checking to see (if userclick is set.  I don't see this anywhere in your code.  I only see (setq userclick1 T).  So perhaps you should change it to test for: (if userclick1

 

 

Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator
Layer Apps | List on Steroids | VP Zoom Scales |Exchange App Store


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

scot-65
Advisor
Advisor

The $value returned is a zero-based index of the current position of the list box or popup list.

IT IS ALSO RETURNED AS A STRING. You will need to convert this into the list you have.

 

For example:
(setq a (list "12" "13" "14"))
and you populate a list box with the start_list sequence.

 

When you get the $value of the highlighted line, for instance
the user selects the line that reads "13", the value returned is "1".
(setq b $value)
To convert this, try (nth (atoi b) a)

 

I personally would not approach the problem in this manner.
My plan of attack is to create a list the moment the OK button is pressed.
It's like taking a snapshot of the DCL at closing time.
(action_tile "accept" "(User_GET)(done_dialog 1)")

 

(setq sd (start_dialog))

will allow one to enter the "main" part of the program:

(if (= sd 1)...

 

I also see that you do not set_tile of either of these lists.

What happens here is a empty string will be returned if nothing is selected.
(set_tile "Column" "0")
(set_tile "Beam" "1")
These can be part of your initialization/set tile sequence.

 

Have a look at my standard LSP file when beginning DCL programs.

You will find it is organized in a logical manner.

 

Good Luck!

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes