Lee Mac Posted September 25, 2015 Posted September 25, 2015 I haven't read the whole thread, but to test whether a string represents a valid number, you could use: (distof <string>) Quote
rlx Posted September 25, 2015 Posted September 25, 2015 Lee Mac said: I haven't read the whole thread, but to test whether a string represents a valid number, you could use: (distof <string>) auwch , didn't see that one coming... hello Lee , this is dragon calling you from down on earth , thank you for yet another lesson :-) Quote
aloy Posted September 25, 2015 Author Posted September 25, 2015 Yes, that is the easiest. Two birds in one shot ( I mean the two problems discussed)!. Thanks both of you. Aloy Quote
rlx Posted September 25, 2015 Posted September 25, 2015 aloy said: Yes, that is the easiest. Two birds in one shot ( I mean the two problems discussed)!.Thanks both of you. Aloy You're more than welcome and looking on the positive side , besides a lesson in humility i not only learned a new trick , i could instandly come up with the stringsearch code so my skill is getting better every day :geek:but still a long road ahead... gr. Rlx Quote
rlx Posted September 27, 2015 Posted September 27, 2015 aloy.lspFetching info... aloy.DCLFetching info... aloy-landscape.zipFetching info... aloy-portrait.zipFetching info... aloy-split1.zipFetching info... aloy-split2.zipFetching info... Quote
aloy Posted September 28, 2015 Author Posted September 28, 2015 Rlx Can portrait be accommodated in the work space?. The pictures are to be replaced with different ones, but about the same size. Will get back to you soon. Aloy Quote
rlx Posted September 28, 2015 Posted September 28, 2015 aloy said: RlxCan portrait be accommodated in the work space?. The pictures are to be replaced with different ones, but about the same size. Will get back to you soon. Aloy Hi Aloy , nos problemos , portrait looks best indeed. gr.Rlx Quote
rlx Posted September 28, 2015 Posted September 28, 2015 Hi Aloy, updated dcl & lsp. Program will search for a aloy.sld and if not present it will draw a red cross. gr. Rlx aloy.DCLFetching info... aloy.lspFetching info... Quote
aloy Posted September 28, 2015 Author Posted September 28, 2015 Hi Rlx, The slide doesn't come up in the dialog. I tried to increase the with and also tried with different aspect ratios but no luck. Aloy Quote
rlx Posted September 28, 2015 Posted September 28, 2015 aloy said: Hi Rlx,The slide doesn't come up in the dialog. I tried to increase the with and also tried with different aspect ratios but no luck. Aloy Are all the files , aloy.lsp , aloy.dcl and aloy.sld in the same folder? and is that folder in your support path? Maybe try to make your own slide. Does (findfile "aloy.sld") find the slide? gr. Rlx Quote
stevesfr Posted September 28, 2015 Posted September 28, 2015 OK, give us a clue where you posted the aloy.sld file ? Quote
rlx Posted September 28, 2015 Posted September 28, 2015 (edited) stevesfr said: OK, give us a clue where you posted the aloy.sld file ? Ah... I see , if you put it that way you're right (starting to sound like my something my wife would say haha) In one of my previous post I attached aloy-portrait.zip and it's just a matter of renaming the slide to aloy.sld. Sorry I didn't mention it. I didn't because Aloy said he was gonna change the picture slightly so I assumed he had or was gonna make his own slide. Hope this clears things up... gr. Rlx btw I did mention : 'updated dcl & lsp. Program will search for a aloy.sld and if not present it will draw a red cross' Edited September 28, 2015 by rlx Quote
aloy Posted September 28, 2015 Author Posted September 28, 2015 I changed the name of the file in lisp to 'aloy-portrait' and ran with all files in C:\temp\lisp as was advised previously before my previous post. The picture did not appear in the dialog. (princ sld) returned nil when defined inside aloy-init-dialog. The red cross too did not appear. Quote
rlx Posted September 29, 2015 Posted September 29, 2015 aloy said: I changed the name of the file in lisp to 'aloy-portrait' and ran with all files in C:\temp\lisp as was advised previously before my previous post. The picture did not appear in the dialog. (princ sld) returned nil when defined inside aloy-init-dialog. The red cross too did not appear. and you are using the code / parts of the code from my post #69??? You probably don't wanna rewrite your own code each time but I assume the dcl is not the problem cause you can use the latest posted but in case of the lsp the aloy_init_dialog gets one extra line for the image. (if (setq sld (findfile "aloy.sld"))(showslide sld "i_graph")(noslide "i_graph")) and add sld to your local var's and you have to add functions showslide & noslide to your own aloy.lsp to. The lsp posted is more or less just for testing / showing how to display the image. When you just use vslide in autocad , you can view the slide without problems? ah , now I get it 'changed the name of the file in lisp to 'aloy-portrait' No just change the name to aloy.sld. It seemed logical to me to have aloy.lsp , aloy.dcl and aloy.sld. My mistake for not communicating that more clearly , sorry for that... but just as I replied in post #73 I wrote : btw I did mention : 'updated dcl & lsp. Program will search for a aloy.sld and if not present it will draw a red cross' I also change the image button's name in the dcl file to "i_graph" assuming you would be using the latest dcl I posted. Hope this clears things up... gr. Rlx Quote
aloy Posted September 29, 2015 Author Posted September 29, 2015 vlide shows an image covering the full screen, but I suppose the vectors take care of sizing it. However the image is disfigured with letters in text broken. I will change the name to aloy and run again as I do not know what is in the compiled slide. Regards, Aloy Quote
rlx Posted September 29, 2015 Posted September 29, 2015 (edited) aloy said: vlide shows an image covering the full screen, but I suppose the vectors take care of sizing it. However the image is disfigured with letters in text broken. I will change the name to aloy and run again as I do not know what is in the compiled slide. Regards, Aloy making a slide from a image does that. Making a slide from a vector based drawing gives far better results. They are just for demo as you said you would make a new picture with other or less info on it. The image will be scaled in the dcl file to fit. When you do make a new picture , you can attach it in a drawing , in model space. Then go to paper space and make an mview and make it's shape fit the image and then make a slide (make sure the mview is active at the moment you make the slide). You can also try to make the slide with a black (modelspace) background and a white background to see what gives a better result. Finally you might have to tweek the size and ratio of your image tile in the dcl file to best fit the ratio of your slide. gr. Rlx Edited September 29, 2015 by rlx Quote
aloy Posted September 29, 2015 Author Posted September 29, 2015 ok thanks. The noslide shows the cross. I think the three types of images also will work. First I will complete my report and get back. Regards, Aloy Quote
aloy Posted October 13, 2015 Author Posted October 13, 2015 Hi Rlx, Have been extremely busy during the last two weeks. Large number of drawings were to be done along with the report. Finally free. I have done the revised 'picture' in the form of a acad drawing and revised the dialog a bit. I am trying to do the error checking before pressing the calculate button. I find that the values attached to the variables are all negative (when negative values have been entered for inputs) except in the case of "Flow" which is tied to "invalid". I want all of them to be "invalid" so that I have to check only for the the strings for defining "Calculate". How can I do that?. The lisp and dcl are attached. Regards, Aloy aloyA.LSPFetching info... aloy.DCLFetching info... Quote
rlx Posted October 13, 2015 Posted October 13, 2015 aloy said: Hi Rlx,Have been extremely busy during the last two weeks. Large number of drawings were to be done along with the report. Finally free. I have done the revised 'picture' in the form of a acad drawing and revised the dialog a bit. I am trying to do the error checking before pressing the calculate button. I find that the values attached to the variables are all negative (when negative values have been entered for inputs) except in the case of "Flow" which is tied to "invalid". I want all of them to be "invalid" so that I have to check only for the the strings for defining "Calculate". How can I do that?. The lisp and dcl are attached. Regards, Aloy Hi Aloy , know what you mean with extremely busy pfff. And for me the end is not in sight. Not sure I understand you correctly but in case you want all the other fields display "invalid" when flow is tied to invalid , just set them in your update_flow (defun update_flow (val) (cond ((<= (atof val) 0) (set_tile "eb_flow" "invalid")(set_tile "eb_pipesize" "invalid")(set_tile "eb_manning" "invalid")(set_tile "eb_slope" "invalid")) ((>= (atof val) (/ (* (/ (* pi (expt (/ (atof dia) 2) 2)) 1000) (* (expt (/ (atof dia) 4000) 0.66) (expt (/ (atof slo) 100.0) 0.5))) (atof man))) (set_tile "eb_flow" "too large")) (t (setq flo (atof val))))) or use (update_pipesize "0") , or if you want to reset pipesize you could first set dia to "0" and then call (update_pipesize dia) . It all depends if you just want to display invallid with or without affecting the variables themself. Another way would be to create subfuction and use mapcar , for example : (defun show-invalid () (mapcar '(lambda(x)(set_tile x "invalid")) '("eb_pipesize" "eb_manning" "eb_slope" "eb_flow"))) and then you could use for every condition (( hope this helps , gotta go back to work now... gr. Rlx Quote
Recommended Posts
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.