I was wondering if there was anyone out their who could help me with a project, my drafting department used a product called Medusa which had a really great straight forward down and dirty ductulator which worked really good. I need to bring this into AutoCAD but I dont have the skill in LISP. The following is the original code from Medusa:
define_constant(!ductulator,proc(object,attribute)
if attribute .is. !activate then
ui!ductulator!visible :- true
endif
if object!label .eq. "Cancel" then
ui!ductulator!visible :- false
elif object!label .eq. "Calculate" then
ui!ductulator_ans!label :- "..."
a=to_real(ui!ductulator_a_txt!value)
b=to_real(ui!ductulator_b_txt!value)
new_a = to_real(ui!ductulator_new_txt!value)
De = ductulator_De(a,b)
new_b = ductulator_b(De,new_a)
if new_b > 0 then
ui!ductulator_ans!label :- "Rnd = "><fixed_string(De,2)[2;] >< " New b = " >< fixed_string(new_b,2)[2;]
else
ui!ductulator_ans!label = "Out of bounds."
endif
endif
endproc)
--------------------------------------------------------------------------------
define_constant(!ductulator_De,proc(a,b)
--------------------------------------------------------------------------------
De = (1.3*(a*b)**.625) / ((a + b)**.25)
return De
endproc)
--------------------------------------------------------------------------------
define_constant(!ductulator_b,proc(De,a)
--------------------------------------------------------------------------------
loop for b over range(1,1000,.005)
if abs(ductulator_De(a,b) - De) < .05 then
loop for bb over range(b,b+1,.0001)
if abs(ductulator_De(a,bb) - De) < .0005 then
return bb
endif
endloop
endif
endloop
return 0
endproc)
----------------------------------------------------------------------------------------------------
This program created a window like the jpg attached
Thanks in advance for anyone help...


Reply With Quote

