Author Topic: create dcl file  (Read 1884 times)

0 Members and 1 Guest are viewing this topic.

taner

  • Guest
create dcl file
« on: August 01, 2009, 02:03:18 AM »
Dear all,

Please see the attached file. It is written for create temp dcl file. I have used it for a long time.

I hope someone can improve it(the function:th-auto-dcl).

Thanks in advance.

TanEr

Changed the attachment.
« Last Edit: August 10, 2009, 04:54:17 AM by Tsec2nd »

taner

  • Guest
Re: creat dcl file
« Reply #1 on: August 05, 2009, 08:02:34 PM »
I am so upset that nobody  pay attention to  this topic! :-( 

stevesfr

  • Newt
  • Posts: 54
Re: creat dcl file
« Reply #2 on: August 05, 2009, 08:52:00 PM »
Would be easier to understand if the dialog boxes were in English !   :ugly:
Can't remember what I'm supposed to forget.

Spike Wilbury

  • Guest
Re: creat dcl file
« Reply #3 on: August 05, 2009, 09:24:47 PM »
I am so upset that nobody  pay attention to  this topic! :-( 


You need to explain, first what the current code does in detail, then translate the text portions that are not in English, then mention what do you exactly think needs to be improved.

Many of the autolisp experts here, will like to see what it is the status of your code advanced that have been done, by you.

Then when they got a chance, they will guide or help you as they can.

Have fun.   

taner

  • Guest
Re: creat dcl file
« Reply #4 on: August 05, 2009, 09:46:14 PM »
an english version:
Code: [Select]
(defun c:t123 (/ b d dcl_id lst voff von vop ttt fn)
  (setq lst '(vth
     (la%
      "【Von/Voff Calculate】"
      (b-c
(la% "Driven Condition:")
(e-b (la% "Vop" k "k1" va% 3))
(e-b
(la% "1/Duty" k "k2" va% 4)
)
(e-b
(la% "1/Bias" k "k3" va% 3)
)
      )
      s-0
      (b-c
(la% "Voltage:")
(te% (la% "Von:" k "t1"))
(te%
(la%
 "Voff:"
 k
 "t2"
)
)
      )
      s-0
      (r
((bu%
 (la% "Exit" k "cancel" i-c t)
)
(bu%
 (la%
  "Calc"
  k
  "cal"
 )
)
)
      )
     )
    )
  )
  (setq fn (th-auto-dcl lst nil))
  (setq dcl_id (load_dialog fn))
  (if (not (new_dialog "vth" dcl_id))
    (exit)
  )
  (defun ttt ()
    (setq vop (atof (get_tile "k1")))
    (setq d (atof (get_tile "k2")))
    (setq b (atof (get_tile "k3")))
    (setq von  (/ (* vop (sqrt (/ (+ (- d 1) (* b b)) d))) b)
 voff (/ (* vop (sqrt (/ (+ (- d 1) (* (- b 2) (- b 2))) d))) b)
    )
    (set_tile "t1" (strcat "Von: " (rtos von)))
    (set_tile "t2" (strcat "Voff: " (rtos voff)))
    (mode_tile "k1" 2)
  )
  (mode_tile "k1" 2)
  (action_tile "k1" " (setq k1 $value)")
  (action_tile "k2" " (setq k2 $value)")
  (action_tile "k3" " (setq k3 $value)")
  (action_tile "cancel" " (done_dialog)")
  (action_tile "cal" "(ttt)")
  (start_dialog)
  (unload_dialog dcl_id)
  (vl-file-delete fn)
  (princ)
)

temp dcl file
Code: [Select]
vth : dialog {label = "【Von/Voff Calculate】";
  : boxed_column { label = "Driven Condition:" ;
  : edit_box { label = "Vop" ;
 key = "k1" ;
 value = 3 ;
  }
  : edit_box { label = "1/Duty" ;
 key = "k2" ;
 value = 4 ;
  }
  : edit_box { label = "1/Bias" ;
 key = "k3" ;
 value = 3 ;
  }
  }
 spacer_0 ;
 : boxed_column { label = "Voltage:" ;
  : text { label = "Von:" ;
 key = "t1" ;
  }
  : text { label = "Voff:" ;
 key = "t2" ;
  }
  }
 spacer_0 ;
 : row {  : button { label = "Exit" ;
 key = "cancel" ;
 is_cancel = true ;
  }
  : button { label = "Calc" ;
 key = "cal" ;
  }
  }
  }
« Last Edit: August 05, 2009, 10:52:42 PM by taner »

Spike Wilbury

  • Guest
Re: creat dcl file
« Reply #5 on: August 05, 2009, 10:26:26 PM »
have not done dcl on years....

for what I see, there are a lot of strings that need to be between " "

for example on this one test2:
Quote
batchplot : dialog {label = "【批量打印】------TanEr於2009/06/24";
  : row {  : button { label = "退     出" ;
 key = "cancel" ;
 is_cancel = true ;
 width = "1'-3\"" ; <<<
 height = "2\"" ; <<<
  }
  : button { label = "打     印" ;
 key = "print" ;
 width = "1'-3\"" ; <<<
 height = "2\"" ; <<<
  }
  : button { label = "預     覽" ;
 key = "preview" ;
 width = "1'-3\"" ; <<<
 height = "2\"" ; <<<
  }
  }
  }

and this is the temp created:

Quote
batchplot : dialog {label = "【批量打印】------TanEr於2009/06/24";
  : row {  : button { label = "退     出" ;
 key = "cancel" ;
 is_cancel = true ;
 width = 1'-3" ;
 height = 2" ;
  }
  : button { label = "打     印" ;
 key = "print" ;
 width = 1'-3" ;
 height = 2" ;
  }
  : button { label = "預     覽" ;
 key = "preview" ;
 width = 1'-3" ;
 height = 2" ;
  }
  }
  }

Same problem on the test3

HTH

taner

  • Guest
Re: creat dcl file
« Reply #6 on: August 06, 2009, 04:21:44 AM »
I know this caused by Units setting. I can not solve it for the time being. :-D

taner

  • Guest
Re: creat dcl file
« Reply #7 on: August 07, 2009, 03:45:27 AM »
Changed the attached at first floor.

« Last Edit: August 07, 2009, 04:20:23 AM by Tsec2nd »