Jump to content

dcl start up


aloy

Recommended Posts

Hi Rlx,

Problem solved and it is working well. However I had to recast the dialog as there are to solutions to the calculations when the pipe is more than some 80 odd percent full. Therefore I have revised it to be consistent as shown below. And I give below the dcl for that. I now want to remove the edit boxes appearing below "Max. flow" in "input" box column and also remove the three top edit boxes in the two solution columns. My attempts to do that get me error messages. Could you give an advice please?.

Dialog1.JPG

aloy2.dcl

Link to comment
Share on other sites

  • Replies 151
  • Created
  • Last Reply

Top Posters In This Topic

  • aloy

    72

  • rlx

    67

  • Lee Mac

    6

  • stevesfr

    3

Top Posters In This Topic

Posted Images

Hi Aloy,

 

Little difficult to say with so little information about the error and the lisp file but my guess would be that you removed the edit box in your dcl file but not in your lsp and that now your routine still has some code trying to set a tile that does no longer exist. Not much to tell about the dcl file itself you uploaded because it's a small part of your original i assume.

 

Try setting break on error in your debug pull down from your lispeditor and when the programm stops , under view look at your error trace. Think you then can quickly see what's causing your error.

 

gr. Rlx

Link to comment
Share on other sites

I am extremely sorry Rlx I have sent the wrong file that was in the desktop. Here is the correct one. I only used the previous one to start coding then continued it on the other folder.

 

Regards,

 

Aloy

aloy2.dcl

Link to comment
Share on other sites

I am extremely sorry Rlx I have sent the wrong file that was in the desktop. Here is the correct one. I only used the previous one to start coding then continued it on the other folder.

 

Regards,

 

Aloy

 

This still is the previous dcl version. But anywayz , my previous comments are still valid , what is giving you an error ,the dcl file or the lisp file and what is this error? Make sure you try to init the correct tile names and before you do so , validate the value before you attempt to set the tile. Something like :

 

(if (distof dia)(set_tile "diameter" dia)(set_tile "diameter" "invalid number"))

 

You can do so per variable or make a list from your variable names and a list from your tilenames and mapcar away.

 

Gr. Rlx

Link to comment
Share on other sites

Sorry again, the file has been in a different computer. What is missing is only the definition of the calculate button. I will try to do what you said. Will be travelling to a nearby country,Singapore, tomorrow for a week. Will post a reply or the final outcome of this thread after that. Thanks.

Regards,

Aloy

Link to comment
Share on other sites

No worries. I'll hear from you when you're ready again. One thing i've learned in all these years is check and double check every step. Better one check to many ... and make sure every variable has a default value if something goes wrong.

 

See ya later alligator...

 

gr. Rlx

Link to comment
Share on other sites

I assumed you still want it in portrait mode. You can decide how to rename it. In the dialog I last posted (#66) I called it aloy.sld. Not sure what dialog / code / version you're using right now but I guess by now you know how all the pieces fit :-)

 

 

gr. Rlx

Aloy-Slide1.zip

Aloy-Slide2.zip

Edited by rlx
Link to comment
Share on other sites

  • 2 weeks later...

Hi Rlx,

Returned at the beginning of the week. Was busy trying to do the lisp to make the two dialogs stable. That is to prevent someone enter the wrong data end press calculate button. Hope I have succeeded. A typical code snippet is given below. I am sure there may be better and efficient way to do it. Nevertheless it appear to work. The two dialogs for the two versions of solutions are also given below. I tried your slides in post #66. Since the texts in them appear to be not legible decided not to append them to the dialogs.

 

Thanks for all the help.

 

(defun update_flow (val)   
 (cond
   ((not(and (distof dia) (distof man) (distof slo))) (progn (foreach tile eb_list1 (set_tile tile "-")) (alert "Enter valid values first for 'D', 'S' and 'n'"))) 
   ((and (distof dia) (distof man) (distof slo)) (progn (flowcheck) (set_tile "eb_mflow" q1)))
   ((equal (distof val) nil) (setq flo "invalid"))
   ((<= (distof val) 0) (setq flo "invalid"))
    ((>= (distof val) (distof q1)) (progn (set_tile "eb_flow" "too large") (setq flo "invalid")))    
   (t (setq flo val))))    
      
 
(defun update_slope (val)
 (cond
   ((equal (distof val) nil) (progn (set_tile "eb_slope" "invalid") (set_tile "eb_mflow" "invalid") (setq slo "invalid")))   
   ((<= (distof val) 0)
    (progn (set_tile "eb_slope" "invalid") (setq slo "invalid") (set_tile "eb_mflow" "invalid"))) 
   ((>= (distof val) 5.0)
    (progn (set_tile "eb_slope" "too large") (setq slo "invalid") (set_tile "eb_mflow" "invalid")))
   ((and (distof dia) (distof man)) (progn (flowcheck) (set_tile "eb_mflow" q1)))
   (t (progn (set_tile "eb_slope" val) (setq slo val)))))

(defun Calculate()

(if (not(and (distof dia) (distof man) (distof flo) (distof slo))) (progn (foreach tile eb_list1 (set_tile tile "-")) (alert "Value(s) entered inconsistent")))
(if (and (distof dia) (distof man) (distof flo) (distof slo)) (progn(pipe) 
 (flowcheck)
 (set_tile "eb_mflow" q1)  
 (set_tile "eb_depthofflow" gdx)
 (set_tile "eb_centralangle" thita1)								
 (set_tile "eb_nn_full" rt)								
 (set_tile "eb_fullboreflow" gq2)
 (set_tile "eb_fullborevel" gv1)  
 (set_tile "eb_wetted_peri" p1)
 (set_tile "eb_hydra_rai" ar1)  
 (set_tile "eb_cross_sect" a1)
 (set_tile "eb_pipe_full" pf)
 (set_tile "eb_velocity" gv)
 (set_tile "eb_roughness" n1))))

nFixed.JPG

nVaries.JPG

Edited by rkmcswain
added [CODE] tags
Link to comment
Share on other sites

Hi Aloy,

 

Glad you've got things worked out. Been (am) rather busy too. Wife needed a bigger hobby room and guess who had to move...

 

Don't worry about one code being more efficient or not. Unless you work at Nasa where every bit has to count to fit in the memory of the computer , its the one that works and make sense to you that counts. Sure you can sometimes macpar the hell out of a program but it does not always lead to a program that's better to read or to maintain. Maybe you write an app for a company and your successor has to to able to extend one of your routines. Nobody cares if your app runs 10 milli seconds faster but they will care if it can be easily modified. And one year after you've written an app you too will be asking , mm, what was I thinking?

 

But it was fun to be able to help. Maybe as a bad bad dragon I'll get some 'air-miles' for that haha.

 

Gr. Rlx

Link to comment
Share on other sites

Sure, you will get 'air-miles' if this becomes successful. In a way this may be the first of its kind. Dialog aside, the '(pipe)' can be the basis for the analysis of a sewerage network and automate the process of design and drafting of a system (plan and long sections) as it has already been used to analyse one, during the last couple of months.

I must not forget the help by Lee Mac, by his contribution in here (the 'distof' featured prominently) as such I owe him a big thank you.

Regards,

Aloy

Link to comment
Share on other sites

Hi Rlx,

I am back again,

Been trying to insert a slide just to explain what all these values in the edit boxes for one of the versions. However I am unable to get the drawing to cover the complete area of the picture. Could you pl help?. I give the dialog and the two files below. It is better to have the BG colour white with the yellow text turned black. Never mind about the initialization of the EBs.

Capture1.jpg

aloy (7).lsp

aloy.dcl

variableN.dwg

Edited by aloy
Link to comment
Share on other sites

Hi Aloy,

 

 

Can't open your dwg (autocad 12 here at work) but I think the problem shouldn't be to hard to fix. Maybe read post #77 were I explained how I make a slide via model / paper space and use a mview. Make sure zoom use zoom extends in your mview before you make the slide. Maybe scaling your entire dwg by a factor of 2 will have effect.

 

 

Found a link about the problem , dunno if its any good : http://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/dimensions-of-image-slide-dcl-and-lisp/td-p/3539154

 

 

Anywayz , I will look again 2nite when i'm home.

 

 

Gr. Rlx

Link to comment
Share on other sites

Rlx,

Yes it appears ok, but not large enough to see details. I have got the following by making the height 15 and the aspect ratio 1. The slide was made after zooming extent. I need to increase the picture size so that the text will be legible.

Any help?. Thanks for the link

Aloy.

Capture2.PNG

Edited by aloy
Link to comment
Share on other sites

Hi Aloy.

 

 

Couple of thing you can do. Dont use a fat font for your text's , use something like isocp. Increase your textsize slightly. I dont think a bigger image box would look good. You could maybe split your image in 2 and slightly increase the height of both image boxes in your dialog so the slides would use the available space as optimal as possible. And last option would be to create a second dialog with just one huge image tile on it and assign a zoom action to the image in your main dialog. Then when you click on the image in your main dialog , a second dialog would appear that really shows your slide a big as possible.

 

 

Maybe I have some time 2nite to cook something up for you but I have 2 little terrorists who want to come sleep over and they can really demand someones complete attention haha. But they have to go to school 2morrow so how bad could it get? (i'll tell you in the morning ;-)

 

 

gr. Rlx

Link to comment
Share on other sites

Hi Aloy,

 

 

updated your lsp and dcl file. If you click on the slide you now get a bigger version of the slide. Click on it again and you go back to the main dialog.

 

 

Note that I changed : image to : image_button

 

 

gr. Rlx

aloy (7).lsp

aloy.DCL

Link to comment
Share on other sites

Hi Rlx,

It doesn't work when I tried. I think you need to define another dialog by the name "zoomslide" as per the code (new_dialog "zoomslide" Dcl_Id%), if I am not mistaken. Isn't the slide imposed on a very large button?. Look at this part of the code:

 

(defun aloy_zoom_slide ( /  x y )
 (new_dialog "zoomslide" Dcl_Id%)
 (setq x (dimx_tile "bigslide") y (dimy_tile "bigslide"))
 (start_image "bigslide")
 (slide_image 0 0 x y (findfile "variableN.sld"))
 (end_image)
 (action_tile "bigslide" "(done_dialog)")
 (start_dialog)
)

Link to comment
Share on other sites

Hi Aloy ,

 

 

it works fine with me. If you look at the dcl file in the previous post (#97) I have added the "zoomslide" dialog definition so maybe you use the incorrect version? Try (findfile "aloy.dcl") and see if the path and filename returned are the correct one.

 

 

One more post and we can celebrate the 100th post :-)

 

 

btw , when you get it working , you see what I mean about not using fat fonts. Use a single line font.

 

 

gr. Rlx

Edited by rlx
Link to comment
Share on other sites

Hi Aloy ,

 

 

 

One more post and we can celebrate the 100th post :-)

 

 

btw , when you get it working , you see what I mean about not using fat fonts. Use a single line font.

 

 

gr. Rlx

 

it works fine with me. If you look at the dcl file in the previous post (#97) I have added the "zoomslide" dialog definition so maybe you use the incorrect version? Try (findfile "aloy.dcl") and see if the path and filename returned are the correct one.

 

rlx and aloy, it works fine here, but I wonder if we are ever going to see the complete working lisp file ????

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...