Jump to content

acet-help not loading from Lisp


slimpickinz

Recommended Posts

When I strip out all my dialog, and just keep the 3 tiles OK Cancel & Help, the .chm I have created opens when I click the Help button.

But when I add the code to the full routine, the dialog loads properly, the routine runs, OK & Cancel work, but the Help button does nothing.

All the files are in a set path, I am stumped here.

Please take a look at the code and see if you see something I am missing here.

The Lisp is a bit rough right now I realize, but I will improve on the functionality after I get this fixed.

>

 

Thanks

SlimP

 

//DCL CODING STARTS HERE
pid4 : dialog {
label = "PID v1.0" ;

: spacer {
height          = 1 ;
}
: boxed_column {
: row {
: boxed_column {
label = "SUCTION GROUPS";
fixed_width = true;
fixed_height = true;
fixed_width_font = true;
: popup_list {

key = "suctgrps";
value = "0" ;
edit_width = 20;
}
}
//: spacer {
//width          = 3 ;
//}
//: spacer {
//height          = 1 ;
//}

//Subcooler Options
: row {
: boxed_column {
label = "SUBCOOLING";
fixed_width = true;
fixed_height = true;
fixed_width_font = true;
: popup_list {

key = "subcool";
value = "0" ;
edit_width = 20;
}
}
: spacer {
width          = 3 ;
}

// Liquid Injection Option Yes or No

: row {
: boxed_column {
label = "LIQ. INJECTION (LT)";
fixed_width = true;
fixed_height = true;
fixed_width_font = true;
: popup_list {

key = "liqinj";
value = "0" ;
edit_width = 20;
}
}
 }
 }
 }
 }
: spacer {
width          = 30 ;
}

//BEGIN COMPRESSOR SELECTION
: boxed_column {
label = "COMPRESSORS";
: row {
: column {
fixed_width = true;
fixed_height = true;
fixed_width_font = true;
: row {
: boxed_column {
label = "COMPRESSOR 1";
: popup_list {
key = "comp1un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp1vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp1dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp1hfan";
value = "0" ;
edit_width = 11;
}
}
: boxed_column {
label = "COMPRESSOR 2";
: popup_list {
key = "comp2un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp2vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp2dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp2hfan";
value = "0" ;
edit_width = 11;
}
}
: boxed_column {
label = "COMPRESSOR 3";
: popup_list {
key = "comp3un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp3vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp3dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp3hfan";
value = "0" ;
edit_width = 11;
}
}
: boxed_column {
label = "COMPRESSOR 4";
: popup_list {
key = "comp4un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp4vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp4dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp4hfan";
value = "0" ;
edit_width = 11;
}
}
: boxed_column {
label = "COMPRESSOR 5";
: popup_list {
key = "comp5un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp5vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp5dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comp5hfan";
value = "0" ;
edit_width = 11;
}
}
 }
: row { 
: boxed_column {
label = "COMPRESSOR S1";
: popup_list {
key = "comps1un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps1vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps1dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps1hfan";
value = "0" ;
edit_width = 11;
}
}
: boxed_column {
label = "COMPRESSOR S2";
: popup_list {
key = "comps2un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps2vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps2dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps2hfan";
value = "0" ;
edit_width = 11;
}
}
: boxed_column {
label = "COMPRESSOR S3";
: popup_list {
key = "comps3un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps3vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps3dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps3hfan";
value = "0" ;
edit_width = 11;
}
}  
: boxed_column {
label = "COMPRESSOR S4";
: popup_list {
key = "comps4un";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps4vfd";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps4dig";
value = "0" ;
edit_width = 10;
}
: popup_list {
key = "comps4hfan";
value = "0" ;
edit_width = 11;
}
}
 }
  }
   }
    }

//}
//BEGIN LOOP SELECTION
: boxed_column {
label = "LOOP CIRCUITS";
: row { 
: boxed_column {
label = "LOOP 1";
: popup_list {
key = "loop1";
value = "0" ;
edit_width = 15;
}
}
: boxed_column {
label = "LOOP 2";
: popup_list {
key = "loop2";
value = "0" ;
edit_width = 15;
}
}
: boxed_column {
label = "LOOP 3";
: popup_list {
key = "loop3";
value = "0" ;
edit_width = 15;
}
}  
: boxed_column {
label = "LOOP 4 (SC)";
: popup_list {
key = "loop4";
value = "0" ;
edit_width = 15;
}
}
 }

 : row { 
: boxed_column {
label = "LOOP S1";
: popup_list {
key = "loops1";
value = "0" ;
edit_width = 15;
}
}
: boxed_column {
label = "LOOP S2";
: popup_list {
key = "loops2";
value = "0" ;
edit_width = 15;
}
}
: boxed_column {
label = "LOOP S3";
: popup_list {
key = "loops3";
value = "0" ;
edit_width = 15;
}
}  
: boxed_column {
label = "LOOP S4 (SC)";
: popup_list {
key = "loops4";
value = "0" ;
edit_width = 15;
}
}
 }
  }
//   
//CONDENSER OPTIONS
//
: boxed_column {
fixed_width = true;
label = "CONDENSER" ;
: boxed_column {
label = "Condenser Location";
: popup_list {
key = "cond1";
value = "0" ;
edit_width = 25;
}
}
: boxed_column {
label = "Water Heat Reclaim";
: popup_list {
key = "whr";
value = "0" ;
edit_width = 25;
}
}
//: boxed_column {
//fixed_width = true;
//label = "RECEIVER" ;
: boxed_column {
label = "Receiver Size";
: popup_list {
key = "rec1";
value = "0" ;
edit_width = 15;
}
}
 }




 ////////////////// BUTTONS /////////////////////
: row
 {
   spacer;
   spacer;
   spacer;
   spacer;
   : button {
     fixed_width=true;
     width=13;
     key="accept";
     is_default=true;
     label= "OK";
   }
   : button {
     fixed_width=true;
     width=13;
     is_cancel=true;
     key="cancel";
     label= "Cancel";
   }
   : button {
     fixed_width=true;
     width=13;
     key="help";
     label= "&Help";
     is_help=true;
   }

}


//ok_cancel_help ;
}
//DCL CODING ENDS HERE

pid903.LSP

acet.zip

Link to comment
Share on other sites

  • Replies 91
  • Created
  • Last Reply

Top Posters In This Topic

  • The Buzzard

    36

  • slimpickinz

    34

  • CAB

    21

  • gile

    1

Top Posters In This Topic

Posted Images

It appears you are calling for a function called acet-help.

 

           (action_tile "help" "(acet-help)")

 

I did not find a function by this name in your program.

Also I think you cannot use "help" as a key as it is reserved for acad help function. (not exactly sure)

Link to comment
Share on other sites

Hi,

 

Try

 

(action_tile "help" "(help \"acet\")")

 

gile,

 

That work great except the acet.chm needed to be renamed to acet-help.chm, Otherwise it opens express tools help file.

 

I added the change with the renamed help file in the attached zip file.

 

(action_tile "help" "(help \"acet-help\")")

 

Also the action tile needed to be placed here and not at the end of the program. See below.

 

;
;
;          /////////////////////     End  of List Box Build  Section      \\\\\\\\\\\\\\\\\\\\\\\\\ 
;
(action_tile
"help"
"(help \"acet-help\")"
)
(action_tile
"accept"
"(get_data) (done_dialog) (setq userclick T)"
);action tile
(action_tile
"cancel"
;if cancel button pressed
"(done_dialog) (setq userclick nil)"
;close dialog
);action_tile
(start_dialog)
;start dialog
(unload_dialog dcl_id)
;  
;
;          /////////////////////     End  of List Box Build  Section      \\\\\\\\\\\\\\\\\\\\\\\\\ 
;
; **************************************************************************************

 

 

 

 

 

 

Nice fix

pid4.zip

Link to comment
Share on other sites

Perfect!

I swear I tried that way (sort of)...

After a while it all starts to run together.

I need to learn patience when dealing with this lisp stuff.:)

 

One other thing maybe one of you could help me with...

Once I run the program, and I see that I missed answering one of the questions correctly,

I would like the program to "remember" the previous selections so I do not have to answer ALL the questions again, only the one I want to change/revise.

That would be a big plus for this.

 

I also realize I should put in an error trap.

Which type do you prefer?

Link to comment
Share on other sites

Perfect!

I swear I tried that way (sort of)...

After a while it all starts to run together.

I need to learn patience when dealing with this lisp stuff.:)

 

One other thing maybe one of you could help me with...

Once I run the program, and I see that I missed answering one of the questions correctly,

I would like the program to "remember" the previous selections so I do not have to answer ALL the questions again, only the one I want to change/revise.

That would be a big plus for this.

 

I also realize I should put in an error trap.

Which type do you prefer?

 

slimpickinz,

 

Attached is a program with two popup lists that will remember the last selection. Just go to the Main Function in this program to see how this is done. I think you will be able to figure this one out. Pay close attention to all the action tiles including the accept or OK button. Everything you need to do this is in there.

This is just a simple generic program that has no other use but to serve as a dialog sample. It does function well for its intended purpose.

 

As far as the error trap is concerned, Get thru this part first and we will worry about error trapping later.

 

Good Luck,

The Buzzard

SL.zip

Link to comment
Share on other sites

On second thought the above posted program, I just realized that I did not declare local variables. This may not be as good an example as I originally thought. It may complicate things for you. You cannot declare local variables for the action tiles as they will not remember there last settings because they lose there values after the program completes. They would need to be made as an obscure variable which is not declared and pass their values to another variable to be used in the program, Then those variables can be declared local.

 

You can still use the above program, But you will need to keep this in mind when setting your variables up to remember there last settings.

 

I will see if can come up with a better example or if someone else can post a better explanation. I hope you understand what I have just explained. If you get stuck I will try to get you past it. I did not want you to get too far ahead of yourself just to find this out.

 

Sorry about that slimpickinz,

I did not mean to complicate this more for you.

Link to comment
Share on other sites

...after looking through your example, it did seem to confuse me some.

Actually there are alot of variables to redefine in my program.

I think this would make the code way too long...agree?

 

I will wait and see what comes up.

I appreciate your help!

 

I am off to work on my .chm file now, which is much more enjoyable for me.

Link to comment
Share on other sites

...after looking through your example, it did seem to confuse me some.

Actually there are alot of variables to redefine in my program.

I think this would make the code way too long...agree?

 

I will wait and see what comes up.

I appreciate your help!

 

I am off to work on my .chm file now, which is much more enjoyable for me.

 

OK, I shortened the program to give you only what you need to see and fixed the variable problem. I hope this helps. Do not give up!

Yes you have alot of variables, So what! You are writting an interesting application. The effort you put into it now will return big rewards.

Because the program you are trying to create seems to be a tall order for you is a good reason to see this thru. Complete what you start!

 

You will not gain the knowledge by giving up on this. Yes, programming is difficult. The whole reason we do this is to make our jobs better to deal with in the first place. I am very impressed with what you have put together so far.

 

Please review what I have now posted. Get started and finish.

There is alot of help here for you in your corner.

 

Good Luck

SYMB.zip

Link to comment
Share on other sites

I am a persistent sort, and appreciate the encouragement.

Since you are helping so much I am attaching all the project files

including the drawing that goes with the app, just to show you what I have got so far.

If you would like to suggest any thing you think would help please feel free.

I really enjoy learning like this, and the end result will be a big help.

Again, I really appreciate the assistance.

I really hope that someone else will gain some knowledge from this thread.

 

I will look at your file and see what I can do. At this point I feel very confidant,

& if I cannot figure out a portion of it, I will get back with you.

I am looking forward to sharing the final result with all as well.

pid4.zip

PID-DWG.zip

Link to comment
Share on other sites

I am a persistent sort, and appreciate the encouragement.

Since you are helping so much I am attaching all the project files

including the drawing that goes with the app, just to show you what I have got so far.

If you would like to suggest any thing you think would help please feel free.

I really enjoy learning like this, and the end result will be a big help.

Again, I really appreciate the assistance.

I really hope that someone else will gain some knowledge from this thread.

 

I will look at your file and see what I can do. At this point I feel very confidant,

& if I cannot figure out a portion of it, I will get back with you.

I am looking forward to sharing the final result with all as well.

 

Thats the spirit! Just take it one variable at a time. It will be done before you know it. I will look over what you have posted and get back to you with any suggestions that may be helpful.

Link to comment
Share on other sites

I noticed you have [select One...] [unloaded?] etc, etc.

You do not need to do this. Just have the program default to the first ones in the lists that will have the program perform correctly. Otherwise, you will need to provide error trapping for all these questions which is overkill. It seems you have the defaults in place already.

 

When the user selects the OK button without changing anything in the lists, The program will perform without the need for error trapping in this case. It will be upto the user to change the selections as deemed fit.

 

This will save alot of useless extra programming for starters.

Link to comment
Share on other sites

I am afraid I have started with such a convoluted method, I am going to have to re-do this thing just to make sense of your few lines....

 

 

See if I am catching on here...

 

 (start_list "pl1")
 (mapcar 'add_list ds_list)
 (end_list)

 (setq SYM  "Triangle")

 (if SYM:DEF (set_tile "pl1" (itoa SYM:DEF)))

where "pl1" is my popup_list key

and this line

  (setq SYM  "Triangle")

sets the list default value when starting the program?

 

Then this...

  (action_tile "accept"
   (strcat
    "(progn
     (setq S:YM (atoi (get_tile \"pl1\")) SYM:DEF S:YM)"

sets the list so it can recall the previous selection?

 

 

.

Link to comment
Share on other sites

I am afraid I have started with such a convoluted method, I am going to have to re-do this thing just to make sense of your few lines....

 

 

See if I am catching on here...

 

 (start_list "pl1")
 (mapcar 'add_list ds_list)
 (end_list)

 (setq SYM  "Triangle")

 (if SYM:DEF (set_tile "pl1" (itoa SYM:DEF)))

where "pl1" is my popup_list key

and this line

  (setq SYM  "Triangle")

sets the list default value when starting the program?

 

Then this...

  (action_tile "accept"
   (strcat
    "(progn
     (setq S:YM (atoi (get_tile \"pl1\")) SYM:DEF S:YM)"

sets the list so it can recall the previous selection?

 

 

.

 

 

You got it!

Just remember the variables used that are obscure look like this: S:YM, D:SF and are not declared, Because if you declare them their values would be lost upon program completion and they would not remember their last value.

 

You can also see the transition to another variable that can be declared.

 

Example:

  (cond
   ((= S:YM 0)(setq SYM "Triangle"))
   ((= S:YM 1)(setq SYM "Square"))
   ((= S:YM 2)(setq SYM "Circle"))
 )
 (cond
   ((= D:SF 0) (setq DSF  "1/32\" = 1'"))
   ((= D:SF 1) (setq DSF  "1/16\" = 1'"))
   ((= D:SF 2) (setq DSF  "3/32\" = 1'"))
   ((= D:SF 3) (setq DSF  "1/8\" = 1'"))
   ((= D:SF 4) (setq DSF  "3/16\" = 1'"))
   ((= D:SF 5) (setq DSF  "1/4\" = 1'"))
   ((= D:SF 6) (setq DSF  "3/8\" = 1'"))
   ((= D:SF 7) (setq DSF  "1/2\" = 1'"))
   ((= D:SF  (setq DSF  "3/4\" = 1'"))
   ((= D:SF 9) (setq DSF  "1\" = 1'"))
   ((= D:SF 10)(setq DSF  "1-1/2\" = 1'"))
 )

Link to comment
Share on other sites

Please understand, Yes you have alot of variables. But!, You have a program that is doing an awful lot of work in one shot. Try doing this work without a program. What you are trying to accomplish is wonderful. So pursue your goal. Take it one variable at a time. Do not get overwhelmed with the size of the project.

Link to comment
Share on other sites

The reason I did all those Select One... is that there may not be a component related to that group. That way if there are only 3 compressors then you do not touch comp4 or 5, it will not display those units. What I want to do is have a radio button for each unit, "yes or no"...

The if yes, all other selections are made available, if no, it turns them "off" and possibly "greys out" or disables the selection.

Link to comment
Share on other sites

The reason I did all those Select One... is that there may not be a component related to that group. That way if there are only 3 compressors then you do not touch comp4 or 5, it will not display those units. What I want to do is have a radio button for each unit, "yes or no"...

The if yes, all other selections are made available, if no, it turns them "off" and possibly "greys out" or disables the selection.

 

There is another way to accomplish this, But is abit more involved. I would have to write you another example on how to do this. What you would need to do is extract only certain info from your list based on certain criteria.

 

I believe there are other threads by ASMI and Lee Mac on this subject to extract list items.

 

View this thread and the program and watch what happens to the lists when certain radio buttons are selected.

http://www.cadtutor.net/forum/showthread.php?t=34891

Link to comment
Share on other sites

I am also using a lazy button, to reset all layers and restart the app upon error or redo.

Kinda sloppy, but it works.

 

I will work on your recall method.

Thanks a TON.

I am also going to start commenting off to the side as you do.

Much easier to follow.

Link to comment
Share on other sites

I am also using a lazy button, to reset all layers and restart the app upon error or redo.

Kinda sloppy, but it works.

 

I will work on your recall method.

Thanks a TON.

I am also going to start commenting off to the side as you do.

Much easier to follow.

 

Did you run the program from the thread I pointed out to you?

Did you notice what happened to the lists?

 

I think this is what you may be after.

I believe you have the smarts to tackle this.

It is upto to you to decide whats best for your program.

I am just giving you a push in a certain direction.

Link to comment
Share on other sites

yes I did run it and noticed that depending on the selection (interior door, cabinet door etc), the list choices change. Interesting.

 

What ya think about this?

If Comp Qty is picked at 2, then default 3 4 & 5 to blank values, or maybe a "dash".

If the value is blank, the layers are turned off.

 

comp-pid.jpg

 

 

 

-SlimP

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