Jump to content

dcl start up


aloy

Recommended Posts

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 ????

 

 

Yeah , 100 , lets party!!!! smilie.png

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

 

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

 

 

 

 

That's entirely up to Aloy , I just tried to help him out when I could and the math / app is probably beyond me anywayz. My work is mostly electrical wiring diagrams and instrument loops etc.

 

 

gr.Rlx

Link to comment
Share on other sites

Yes it is a wonderful job, having started without even getting "hallo world" we have come this far due to the help I got from here. I was not getting the last one as I had renamed the "variableN.sld" that was in the search path thinking of adjusting the font size and color later. The lisp for the dialog will not be useful without the actual calculator "pipeflow" as there are some alert boxes that appear depending on the inputs the user try to type in. If I put here the complete solution,"airmiles" might be a problem. Anyway I would appreciate if Rlx contact me through the admin.

Aloy

Link to comment
Share on other sites

Hi Aloy ,

 

I want to say one thing about the 'airmiles' and that it was just a matter of speach. I did not mean I want any credit for your program. It's your program and it's up to you if you want to share it with the world. Just meant if the big guy above or below is real i have something to say in my defence ;-). But when I see how many fans this post has I centainly hope you decide to share it.

 

gr. Rlx

 

btw , you can also compile your app to a vlx file. See my thread about VT. Then glorie will be yours 4ever ;-)

Edited by rlx
Link to comment
Share on other sites

Dear Rlx,

You have helped me from the start by getting the "hello world" on to my screen . Couple of others also tried to help. Perhaps the dcl guys are not many and also I can see the audience with respect sewerage design not mature. Then another bright guy came along to put us on right track. I am thankful to both of you. I am in the last stage of my life and have already promised a close relative of mine that I will give this product and what i will do as per my previous post to automate the design and drafting of sewer network, for use in their company. I, therefore, need to keep the "calculator" (not the dialog) with me for some more time before compiling and releasing. I will give the full code for lisp and dialogs here after I have tested them a few more times.

Regards,

Aloy.

Link to comment
Share on other sites

Hi Aloy,

 

I too have had some pretty tough life experiences and have learned a few lessons. Nobody is immortal and nobody is indispensable, the highest you can achieve in life is temporary inconvenience. I have had lots of colleages thinking the company they worked for would stop working when they left. And I assure you they where completely wrong. It does make me very sad when you write you are in the last stages of your life , but at the same time I hope this will be the beginning of something greater. What can be better than to leave something behind to make the world a better place. Not long ago my cousin in the US died. We only met a few times but we really connected. Thats when I decided to share my apps because here in the Netherlands we say the last shirt has no pockets. I gues the same message as the story from Charles Dickins , Scrooge , the more stuff you have , the havier the burdon you carry whith you or as the Dalai Lama puts it : the thing you really want most from life is simply to be happy. I believe that a person like Lee Mac may or may not the best (lisp) programmer there is (because I can understand most of his programms , not all , but sometimes I find a post from somebody else on the net that allmost explodes my last functioning brain cell ;-) , he himself named himself just a little fish in a big pond , but what really sets Lee apart is his willingness to help people. To share. For that he has my deepest respect. Aloy , do what you do best and do it the way you want it , but to have five thousand reads in so little time makes you very special, never forget that!

 

gr. Rlx

Edited by rlx
Link to comment
Share on other sites

Hi Aloy, just a suggestion; to make the program special worldwide, consider some function where the user can choose between units... mm, m, inches, or feet when entering data and obtaining a useful answer.

Steve

Link to comment
Share on other sites

Hi Rlx,

Thanks for the insight. I too believe in the impermanence to a certain extent, but we need to move on. This morning I was watching a BBC documentary which was explaining about parallel universes etc. I know the creator of that philosophy himself told followers not to bother about these matters so much.

You were writing about Lee Mac. Actually he welcomed me to the forum and later gave me a code snippet which I am using till today with other codes in getting the road alignments, long sections and setting outs on my jobs. I have named it 'Leemaccode'.

Regards,

Aloy

Link to comment
Share on other sites

Hi Steve, I am thinking of using some radio buttons or list box for the user to select which option to use (ie. whether to use fixed 'n' or variable one) and also to select the units.

Thanks for the support.

Aloy

Link to comment
Share on other sites

  • 1 month later...

Hi Rlx,

My computer was down for some time before finishing off with this thread. I have been able to convert to US- Customary units as can be seen in the pictures attached. I have come up with another issue. That is the slide that appear for FixedN is too small. Is there any way this can be made bigger?. I attached the DCL also. For comparison of results for similar flows in another calculator that can be reached online I give their output as well.

Regards,

Aloy

VariableNflow1.jpg

VariableNflow.jpg

PipeCalFixedN.jpg

PipeCalVariableN.jpg

aloy2aim.dcl

Link to comment
Share on other sites

Hi Aloy , long time no see , glad you're still around :-)

 

 

Height of your image in dcl is 20 , ratio 1.7. Try to make your ratio a little bigger. Better maybe make your slide a little smaller because you have one big fat (huge) dialog there :-)

 

 

And allways make sure you have the correct slide when you have more then 1 version. You called your DCL Aloy2aim , then rename your lsp and your slide also to Aloy2aim so there can be no mistake , or, make sure the old versions are gone , archived , kaputt whatever. It can be very frustrating when you're testing , changing and testing again and again and see nothing changing because the file you're loading everytime is not the one you just changed (not that it ever happened to me , ahum...)

 

 

And maybe remake your slide in a viewport that has the same ratio of your image as mentioned in some of the earlier posts.

 

 

gr. Rlx

Link to comment
Share on other sites

  • 1 month later...

Hi Rlx, Happy New Year to you and all others.

I have made a radio button dialog to select the appropriate dialog for the calculations and is given below. Now I want to put and additional button in each of them to save the data in the dialog in a table. Though the table can be created easily I haven't found a way of populating it with the data attached to the variables. Can you or anyone else suggest a way?. Also, I find that Vlisp compiling wizard cannot take in slide files. Does it means I have to upload one VLX and two uncompiled sld files?.

As for the 'huge' dialog for the fixedN versions I have decided to do away with the slides for them.

Regards,

Aloy

FlowTypeSel.JPG

Link to comment
Share on other sites

Hi Rlx, Happy New Year to you and all others.

I have made a radio button dialog to select the appropriate dialog for the calculations and is given below. Now I want to put and additional button in each of them to save the data in the dialog in a table. Though the table can be created easily I haven't found a way of populating it with the data attached to the variables. Can you or anyone else suggest a way?. Also, I find that Vlisp compiling wizard cannot take in slide files. Does it means I have to upload one VLX and two uncompiled sld files?.

As for the 'huge' dialog for the fixedN versions I have decided to do away with the slides for them.

Regards,

Aloy

 

 

Hi Aloy , glad you've come so far with your program. Can't say I have any experience with tables but maybe now would be a good time to start. At this moment our server here is completly down , so maybe I have plenty of time today ;-). I will give your slide problem some thought , because it should be possible to do this with vector_image but then I would first have to be able to convert your drawing and although a nice picture always makes your program look good , in itself it has no real value.

 

 

How would this table have to look and what are the variables / values needed?

 

 

gr.Rlx

Link to comment
Share on other sites

Rlx,

Thanks for the prompt reply. I attach some snipes of a state of the art package by a world renowned organisation. They gave me this package free of charge when I purchased a book on Modeling of Waste Water Systems a couple of years ago; it cost me around $270 at that time, if I am not mistaken. This package does not have the capability of analyzing with varying Manning number though.

What I need to do is to have a similar format of the table to put in my variables attached to all the edit boxes in the dialogs. If I can do one, then can have the same method for other three dialogs as well.

Regards,

Aloy

BentleyPipeAnalysis.jpg

Results.jpg

Link to comment
Share on other sites

Here is a 'test' table and given below is the code, is there a way to give location of (entsel) instead of pointing at the upper left corner of the table created?. I have given some fictitious value for the variable attached to the editboxes of dialog; these will be updated with actual values each time the results are saved:

(defun c:test(/ lst sel myTable row rws cell dia slo man flo		   
	     gdx thita1 gq2 gv1 q1 p1 ar1 rt a1 pf gv n1)
(setq dia 450.0
     slo 1.0
     man 0.012
     flo 80.0
     gdx 200.0
     thita1 1.0
     gq2 350.0
     gv1 1.7
     q1 350.0
     p1 300.0
     ar1 150.0
     rt 1.1
     a1 4000.0
     pf 30.0
     gv 1.1
     n1 0.013)  
(setq lst (list dia slo man flo gdx thita1 gq2 gv1 q1 p1 ar1 rt a1 pf gv n1))
 ;(if (/= lst nil) (setq l(cons lst l)))
(setq l(list lst lst lst)) ; for testing
(setq n(length l))
 (setq n(- n 1))
(command "table" 16 1 '(0 15))
(if (and(setq sel (car (entsel)))
(setq myTable (vlax-EName->vla-Object sel))
 (= (vla-get-ObjectName myTable) "AcDbTable")
(setq rws (vla-Get-Rows myTable))
)
(vla-InsertRows myTable rws (vla-GetRowHeight myTable (1- rws)) n)
)
(vla-settext myTable 0 0 "PIPE FLOW RESULTS")
(vla-settext myTable 1 0 "Pipe Size(mm)")
(vla-settext myTable 1 1 "Slope(%)")
(vla-settext myTable 1 2 "Manning's n")
(vla-settext myTable 1 3 "Flow(l/s)")
(vla-settext myTable 1 4 "Depth(mm)")
(vla-settext myTable 1 5 "CentralAngle(Rad.)")
(vla-settext myTable 1 6 "FullBoreFlow(l/s)")
(vla-settext myTable 1 7 "FullBoreVel(m/s)")
(vla-settext myTable 1 8 "Max. Flow(l/s)")
(vla-settext myTable 1 9 "Wetted Peri.(mm)")
(vla-settext myTable 1 10 "Hydr.Radius(mm)")
(vla-settext myTable 1 11 "Ratio-n/nFull")
(vla-settext myTable 1 12 "CrossSecArea(mm^2")
(vla-settext myTable 1 13 "% PipeFull")
(vla-settext myTable 1 14 "AverageVel.(m/s)")
(vla-settext myTable 1 15 "Roughness")
(setq nCols 15)
(setq row 2)
(setq cell 0)
(if (/= lst nil) 
     (while (/= l nil)
(setq lst(car l))
        (while (<= cell nCols) 
          (vla-settext myTable row cell (car lst))
          ;(vla-setCellAlignment myTable row cell 5)
   (setq lst(cdr lst))
         (setq cell(+ 1 cell))
        )
       (setq l (cdr l))
(setq row(+ row 1))
       (setq cell 0)
     )
)
(princ) 
)

Link to comment
Share on other sites

It appears (entlast) picks some other entity; hence doesn't seem to work.

Also, is there a way to give color to the cells by a lisp code directly without converting to Excel and giving color?.

Link to comment
Share on other sites

Here is a 'test' table and given below is the code, is there a way to give location of (entsel) instead of pointing at the upper left corner of the table created?. I have given some fictitious value for the variable attached to the editboxes of dialog; these will be updated with actual values each time the results are saved:

(defun c:test(/ lst sel myTable row rws cell dia slo man flo           
            gdx thita1 gq2 gv1 q1 p1 ar1 rt a1 pf gv n1)
(setq dia 450.0
     slo 1.0
     man 0.012
     flo 80.0
     gdx 200.0
     thita1 1.0
     gq2 350.0
     gv1 1.7
     q1 350.0
     p1 300.0
     ar1 150.0
     rt 1.1
     a1 4000.0
     pf 30.0
     gv 1.1
     n1 0.013)  
(setq lst (list dia slo man flo gdx thita1 gq2 gv1 q1 p1 ar1 rt a1 pf gv n1))
 ;(if (/= lst nil) (setq l(cons lst l)))
(setq l(list lst lst lst)) ; for testing
(setq n(length l))
 (setq n(- n 1))
(command "table" 16 1 '(0 15))
(if (and(setq sel (car (entsel)))
(setq myTable (vlax-EName->vla-Object sel))
 (= (vla-get-ObjectName myTable) "AcDbTable")
(setq rws (vla-Get-Rows myTable))
)
(vla-InsertRows myTable rws (vla-GetRowHeight myTable (1- rws)) n)
)
(vla-settext myTable 0 0 "PIPE FLOW RESULTS")
(vla-settext myTable 1 0 "Pipe Size(mm)")
(vla-settext myTable 1 1 "Slope(%)")
(vla-settext myTable 1 2 "Manning's n")
(vla-settext myTable 1 3 "Flow(l/s)")
(vla-settext myTable 1 4 "Depth(mm)")
(vla-settext myTable 1 5 "CentralAngle(Rad.)")
(vla-settext myTable 1 6 "FullBoreFlow(l/s)")
(vla-settext myTable 1 7 "FullBoreVel(m/s)")
(vla-settext myTable 1 8 "Max. Flow(l/s)")
(vla-settext myTable 1 9 "Wetted Peri.(mm)")
(vla-settext myTable 1 10 "Hydr.Radius(mm)")
(vla-settext myTable 1 11 "Ratio-n/nFull")
(vla-settext myTable 1 12 "CrossSecArea(mm^2")
(vla-settext myTable 1 13 "% PipeFull")
(vla-settext myTable 1 14 "AverageVel.(m/s)")
(vla-settext myTable 1 15 "Roughness")
(setq nCols 15)
(setq row 2)
(setq cell 0)
(if (/= lst nil) 
     (while (/= l nil)
   (setq lst(car l))
        (while (<= cell nCols) 
          (vla-settext myTable row cell (car lst))
          ;(vla-setCellAlignment myTable row cell 5)
      (setq lst(cdr lst))
         (setq cell(+ 1 cell))
        )
       (setq l (cdr l))
   (setq row(+ row 1))
       (setq cell 0)
     )
)
(princ) 
)

 

 

Hi Aloy ,

 

 

Was kinda busy with another thread so was planning to look into the table thing this weekend but you're doing fine!:thumbsup:

 

 

 (command "table" 16 1 '(0 15)) 
(setq sel (entlast) myTable (vlax-EName->vla-Object sel) rws (vla-Get-Rows myTable))

 

 

 

 

http://www.cadtutor.net/forum/showthread.php?74717-Set-properties-of-dwg-table&highlight=table+cel+color

 

 

 

 

 

gr.Rlx

Edited by rlx
Link to comment
Share on other sites

Hi Rlx,

Thanks for the encouragement. Actually someone else also suggested this and I thought it doesn't work. I do not see his post in the thread. I now see it works perfectly well. I am so happy as I worked till late last night.

Thanks for the link for color also.

 

I see another snippet in the comments at the end of link below. The names of Terry Miller and Lee Mac also mentioned there as contributors:

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/getexcel-lsp-changing-cell-color-of-cells-using-this-routine/td-p/4878052

Edited by aloy
Link to comment
Share on other sites

(vla-settext myTable 0 0 "PIPE FLOW RESULTS")
(vla-settext myTable 1 0 "Pipe Size(mm)")
(vla-settext myTable 1 1 "Slope(%)")
(vla-settext myTable 1 2 "Manning's n")
(vla-settext myTable 1 3 "Flow(l/s)")
(vla-settext myTable 1 4 "Depth(mm)")
(vla-settext myTable 1 5 "CentralAngle(Rad.)")
(vla-settext myTable 1 6 "FullBoreFlow(l/s)")
(vla-settext myTable 1 7 "FullBoreVel(m/s)")
(vla-settext myTable 1 8 "Max. Flow(l/s)")
(vla-settext myTable 1 9 "Wetted Peri.(mm)")
(vla-settext myTable 1 10 "Hydr.Radius(mm)")
(vla-settext myTable 1 11 "Ratio-n/nFull")
(vla-settext myTable 1 12 "CrossSecArea(mm^2")
(vla-settext myTable 1 13 "% PipeFull")
(vla-settext myTable 1 14 "AverageVel.(m/s)")
(vla-settext myTable 1 15 "Roughness")

 

A bit shorter if you'd like.

 

 (setq c -1)
 (vla-settext myTable 0 0 "PIPE FLOW RESULTS")
 (mapcar '(lambda (s) (vla-settext myTable 1 (setq c (1+ c)) s))
         '("Pipe Size(mm)" "Slope(%)" "Manning's n" "Flow(l/s)"
           "Depth(mm)" "CentralAngle(Rad.)" "FullBoreFlow(l/s)"
           "FullBoreVel(m/s)" "Max. Flow(l/s)" "Wetted Peri.(mm)"
           "Hydr.Radius(mm)" "Ratio-n/nFull" "CrossSecArea(mm^2"
           "% PipeFull" "AverageVel.(m/s)" "Roughness"
          )
 )

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...