Jump to content

Recommended Posts

Guest cad2007
Posted

Here i have mentioned the code for lsp tool bar.but some buk is thr.can u chk plz

 

 

 

***MENUGROUP=TestGroup

 

***TOOLBARS

**TB_OTHER_OPTIONS

**TestToolBar

ID_Production_0 [_Toolbar("TestToolBar", _Floating, _Show, 160, 236, 1)]

[--]

ID_UserButton_23 [_Button("Test Tool Tip", "LOADTL.BMP", "LOADTL.BMP")]^C^C(load (findfile "My.lsp"))

[--]

ID_UserButton_24 [_Button("Test Tool Tip", "DC.BMP", "DC.BMP")]^C^C^MyCommand

[--]

Posted

Hi Cad2007,

 

This is my guess, but untested! I am not in the position to test right now. So please keep that in mind. But I am pretty shure it comes close. If you have more questions, please ask, I have always liked the *.mnu files for it is a fast way of programming macro's into your own application.

 

 
***menugroup=TestGroup
***POP1
[MyMenuName]
ID_UserButton_23 [Do my first command]^C^C(load (findfile "My.lsp"))
[--]
ID_UserButton_24 [Do my second command]^C^C^MyCommand

***image
***accelerators
***helpstrings
ID_UserButton_23 [info or help string for ID_UserButton_23]
ID_UserButton_24 [info or help string for ID_UserButton_24]
***TOOLBARS
**TestGroup
 [_Toolbar("TestToolBar", _Floating, _Show, 160, 236, 1)]
 [_Button("Test Tool Tip", "LOADTL.BMP", "LOADTL.BMP")]^C^C(load (findfile "My.lsp"))
 [_Button("Test Tool Tip", "DC.BMP", "DC.BMP")]^C^C^MyCommand

 

Maybe this is of any further help.

 

 

Kind regards,

MarcoW.

 

ps.: check your mailbox for PM

Posted
Hi Cad2007,

 

This is my guess, but untested! I am not in the position to test right now. So please keep that in mind. But I am pretty shure it comes close. If you have more questions, please ask, I have always liked the *.mnu files for it is a fast way of programming macro's into your own application.

 

 
***menugroup=TestGroup
***POP1
[MyMenuName]
ID_UserButton_23 [Do my first command]^C^C(load (findfile "My.lsp"))
[--]
ID_UserButton_24 [Do my second command]^C^C^MyCommand

***image
***accelerators
***helpstrings
ID_UserButton_23 [info or help string for ID_UserButton_23]
ID_UserButton_24 [info or help string for ID_UserButton_24]
***TOOLBARS
**TestGroup
[_Toolbar("TestToolBar", _Floating, _Show, 160, 236, 1)]
[_Button("Test Tool Tip", "LOADTL.BMP", "LOADTL.BMP")]^C^C(load (findfile "My.lsp"))
[_Button("Test Tool Tip", "DC.BMP", "DC.BMP")]^C^C^MyCommand

 

Maybe this is of any further help.

 

 

Kind regards,

MarcoW.

 

ps.: check your mailbox for PM

 

MarcoW,

 

If I am not mistaken, He is using AutoCAD 2007, So he would need to do his editing through the CUI editor and not a Notepad mnu file unless he intends to import it someway.

Posted
MarcoW,

 

If I am not mistaken, He is using AutoCAD 2007, So he would need to do his editing through the CUI editor and not a Notepad mnu file unless he intends to import it someway.

I hate that it 'has' to create a CUI.

Posted
I hate that it 'has' to create a CUI.

 

I do not mean to make assumptions,

 

I am not sure if he will be able to handle the CUI editor without a book full of explainations. As you already know how much lisp has been a problem.

Posted

Sorry for the ambiguity. I meant that I hate that for versions 2007 and up (utilizes CUI), even if you load a MNU, it will create and load a CUI. Such a pain for updating. You have to make your changes (in the MNU), unload the menu and a reload.

Posted
Sorry for the ambiguity. I meant that I hate that for versions 2007 and up (utilizes CUI), even if you load a MNU, it will create and load a CUI. Such a pain for updating. You have to make your changes (in the MNU), unload the menu and a reload.

 

No, I knew what you meant Alan, I was just mentioning the thought of getting the OP through this one.

 

Many experienced users have problems with this too.

Posted (edited)

If you do not have an older version of AutoCAD such as 2004, You will not be able to test the setup you are creating. If there are any errors in what you are doing, It maynot import or show properly in AutoCAD 2007. If this is the case you will be better off creating the toolbars directly through the CUI editor. (See below)

 

Attached below are PDF files with instructions on how to create a Toolbar and add Autolisp to the Toolbar through the CUI editor. These are in english. If you need instructions in your language, I would suggest you look these up in your AutoCAD help files.

Lisp.pdf

Toolbar.pdf

Edited by The Buzzard
Posted

~ The Buzzard & AlanJT ~

 

I might be mistaken also... but this is the way I see it: when it comes to making an application (bunch of menu's with macro's in there...) I feel it is all a matter of repetition. Sorry for my poor explaining but I will give it a try.

 

1. *.mnu

When having a *.mnu file that contains all that is needed in order to have your own menu running (like the code above), you can open it with Notepad or even with the Vlide Editor. Anyway, once its working, you can copy the whole thing and paste it below everyting. Of course add upp the "pop..x.." thing but you can easyly create 5 menu's within one file, no problems...

 

2. Loading and unloading

True: you need to load it with menuload or unload and reload it again in order to make the changes appear. This is just an action that I have learned to get over... I have attempted to make a lisp to unload and reload but this does not work, if one of you sees a challeng in this; be my guest :-)

I found the menu will unload and reload but "the old version of the menu" stays visible. A manual unload / load is needed.

 

3. Repetitions

Once the content of the *.mnu file is made working and you copy and paste a new menu in your file, you can easily edit the macro's. I will try to give an example based on a lisp that needs 3 arguments on input. Forget about the usage, just an example... The lisp:

 

[font=Fixedsys][size=1][color=purple]; just an example[/color][/size][/font]

[size=1][font=Fixedsys][color=red]([/color][color=blue]defun[/color] EnterName [color=red]([/color] FirstName LastName [color=blue]/[/color] [color=red])[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]alert[/color][/font][/size]
[size=1][font=Fixedsys][color=red]([/color][color=blue]strcat[/color] [color=#ff00ff]"Your first name is "[/color] FirstName [color=#ff00ff]" and your last name is "[/color] LastName[color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red])[/color] [color=purple];_alert[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]princ[/color][color=red])[/color][/font][/size]

[size=1][font=Fixedsys][color=red])[/color] [color=purple];_defun[/color][/font][/size]

 

 

Now, once this is loaded into memory, you could make some macro's to do whatever you want, like this "most unuseful example":

 

 
^C^C(EnterName "Marco" "W.")
^C^C(EnterName "Alan" "JT.")

 

Haha... here I remember NOT using arguments.... Well, okay:

 

[font=Fixedsys][size=1][color=purple]; just an example[/color][/size][/font]

[size=1][font=Fixedsys][color=red]([/color][color=blue]defun[/color] c:EnterName [color=red]([/color]  [color=blue]/[/color] FirstName LastName[color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red]([/color][color=blue]setq[/color] FirstName [color=red]([/color][color=blue]getstring[/color] T [color=#ff00ff]"Enter your first name :  "[/color][color=red])[/color][/font][/size]
[size=1][font=Fixedsys]LastName [color=red]([/color][color=blue]getstring[/color] T [color=#ff00ff]"Enter your last name :  "[/color][color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red])[/color][color=purple];_setq[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]alert[/color][/font][/size]
[size=1][font=Fixedsys][color=red]([/color][color=blue]strcat[/color] [color=#ff00ff]"Your first name is "[/color] FirstName [color=#ff00ff]" and your last name is "[/color] LastName[color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red])[/color] [color=purple];_alert[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]princ[/color][color=red])[/color][/font][/size]

[size=1][font=Fixedsys][color=red])[/color] [color=purple];_defun[/color][/font][/size]

 

Again, when using macro's it's easy to make a variations:

 

 
^C^CEnterName;Marco;W;
^C^CEnterName;Alan;JT;

 

Imagine how to make various macro's for things with diameters, layers, etc. You can copy and paste all the way:

(command,color,centerlinetype,diameter)

^C^CdrawDuct;green;hidden;80mm;

^C^CdrawDuct;green;hidden;100mm;

^C^CdrawDuct;green;hidden;125mm;

^C^CdrawDuct;green;hidden;160mm;

^C^CdrawDuct;green;hidden;200mm;

etc...

 

Also, when looking for errors, or if changes are needed, you can have an easy overall look. Am I making sense here?

 

4. The CUI

I have tried to modify things within the CUI and found it to be a large job, very much mouseclicking... In the end I found it not to be my way. So I completed my application, all in menu's. Mostly inserting blocks with predefined layersettings, tilemenus, etc. This is where my company runs on for almost a year, and we are happy with it.

 

I have learned a lot, and still do every day. I feel kind'a stupid explaining this to you guys (in this case Alan & The Buzzard) because you are the ones I learn from. Of course this post is not meant to be educational for you but as my way of explaining something. Let that be clear!

 

 

At this point I believe I have used too much words :? but what the heck, my 2 cnt.

 

Regards,

MarcoW.

Posted

~ The Buzzard & AlanJT ~

 

I might be mistaken also... but this is the way I see it: when it comes to making an application (bunch of menu's with macro's in there...) I feel it is all a matter of repetition. Sorry for my poor explaining but I will give it a try.

 

1. *.mnu

When having a *.mnu file that contains all that is needed in order to have your own menu running (like the code above), you can open it with Notepad or even with the Vlide Editor. Anyway, once its working, you can copy the whole thing and paste it below everyting. Of course add upp the "pop..x.." thing but you can easyly create 5 menu's within one file, no problems...

 

2. Loading and unloading

True: you need to load it with menuload or unload and reload it again in order to make the changes appear. This is just an action that I have learned to get over... I have attempted to make a lisp to unload and reload but this does not work, if one of you sees a challeng in this; be my guest :-)

I found the menu will unload and reload but "the old version of the menu" stays visible. A manual unload / load is needed.

 

3. Repetitions

Once the content of the *.mnu file is made working and you copy and paste a new menu in your file, you can easily edit the macro's. I will try to give an example based on a lisp that needs 3 arguments on input. Forget about the usage, just an example... The lisp:

 

[font=Fixedsys][size=1][color=purple]; just an example[/color][/size][/font]

[size=1][font=Fixedsys][color=red]([/color][color=blue]defun[/color] EnterName [color=red]([/color] FirstName LastName [color=blue]/[/color] [color=red])[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]alert[/color][/font][/size]
[size=1][font=Fixedsys][color=red]([/color][color=blue]strcat[/color] [color=#ff00ff]"Your first name is "[/color] FirstName [color=#ff00ff]" and your last name is "[/color] LastName[color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red])[/color] [color=purple];_alert[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]princ[/color][color=red])[/color][/font][/size]

[size=1][font=Fixedsys][color=red])[/color] [color=purple];_defun[/color][/font][/size]

 

 

Now, once this is loaded into memory, you could make some macro's to do whatever you want, like this "most unuseful example":

 

 
^C^C(EnterName "Marco" "W.")
^C^C(EnterName "Alan" "JT.")

 

Haha... here I remember NOT using arguments.... Well, okay:

 

[font=Fixedsys][size=1][color=purple]; just an example[/color][/size][/font]

[size=1][font=Fixedsys][color=red]([/color][color=blue]defun[/color] c:EnterName [color=red]([/color] [color=blue]/[/color] FirstName LastName[color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red]([/color][color=blue]setq[/color] FirstName [color=red]([/color][color=blue]getstring[/color] T [color=#ff00ff]"Enter your first name : "[/color][color=red])[/color][/font][/size]
[size=1][font=Fixedsys]LastName [color=red]([/color][color=blue]getstring[/color] T [color=#ff00ff]"Enter your last name : "[/color][color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red])[/color][color=purple];_setq[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]alert[/color][/font][/size]
[size=1][font=Fixedsys][color=red]([/color][color=blue]strcat[/color] [color=#ff00ff]"Your first name is "[/color] FirstName [color=#ff00ff]" and your last name is "[/color] LastName[color=red])[/color][/font][/size]
[size=1][font=Fixedsys][color=red])[/color] [color=purple];_alert[/color][/font][/size]

[size=1][font=Fixedsys][color=red]([/color][color=blue]princ[/color][color=red])[/color][/font][/size]

[size=1][font=Fixedsys][color=red])[/color] [color=purple];_defun[/color][/font][/size]

 

Again, when using macro's it's easy to make a variations:

 

 
^C^CEnterName;Marco;W;
^C^CEnterName;Alan;JT;

 

Imagine how to make various macro's for things with diameters, layers, etc. You can copy and paste all the way:

(command,color,centerlinetype,diameter)

^C^CdrawDuct;green;hidden;80mm;

^C^CdrawDuct;green;hidden;100mm;

^C^CdrawDuct;green;hidden;125mm;

^C^CdrawDuct;green;hidden;160mm;

^C^CdrawDuct;green;hidden;200mm;

etc...

 

Also, when looking for errors, or if changes are needed, you can have an easy overall look. Am I making sense here?

 

4. The CUI

I have tried to modify things within the CUI and found it to be a large job, very much mouseclicking... In the end I found it not to be my way. So I completed my application, all in menu's. Mostly inserting blocks with predefined layersettings, tilemenus, etc. This is where my company runs on for almost a year, and we are happy with it.

 

I have learned a lot, and still do every day. I feel kind'a stupid explaining this to you guys (in this case Alan & The Buzzard) because you are the ones I learn from. Of course this post is not meant to be educational for you but as my way of explaining something. Let that be clear!

 

 

At this point I believe I have used too much words :? but what the heck, my 2 cnt.

 

Regards,

MarcoW.

 

I understand what you are saying, But 2007 does not use mnu files. You need to import these. If the OP does not have an older version to test his setup, Then he is working with a blindfold on.

 

Just my 50cents.

Posted (edited)

Customization capabilities, including the CUI (Customize User Interface) file format and the Customize User Interface (CUI) Editor, help you to easily create and modify customized content. The XML-based CUI file replaces the menu files used in releases prior to AutoCAD 2006. Instead of using a text editor to customize menu files (MNU and MNS files), you customize the user interface from within AutoCAD. You can

  • Add or change toolbars, menus, and ribbon panels (including shortcut menus, image tile menus, and tablet menus)
  • Add and modify the commands on the Quick Access toolbar
  • Create or change workspaces
  • Assign commands to various user interface elements
  • Create or change macros
  • Define DIESEL strings
  • Create or change aliases
  • Add descriptive text for command tooltips
  • Control the properties displayed when using rollover tooltips

Migrate Custom MNU or MNS

 

You can migrate custom MNU or MNS files from earlier releases using the Customize User Interface (CUI) Editor. The program transfers all of the data in the MNU or MNS file to a CUI file without modifying the original menu file. The new CUI file is an XML-based file that has the same name as your original menu file, but with a .cui extension.

You can also transfer customization information between files. For example, you can transfer toolbars from a partial CUI file to the main CUI file so that the program can display the toolbar information.

NoteAll elements can be transferred between two CUI files with the exception of the property settings defined under the Quick Properties and Rollover Tooltips nodes.

 

 

 

 

Here is the topic for importing or migrating mnu/mns files to cui.

 

As you can see, This is not a very simple task.

 

My whole point here was, If you do not have an older version prior to 2006 and you are creating a mnu or mns. How do you know you are doing it properly if you cannot test it. If something is wrong and you try to import it to a cui, It may not import or import properly.

 

See attached.

Migrate_Menus.pdf

Migrate_and_Transfer_Customizations.pdf

Edited by The Buzzard
Posted
If you do not have an older version of AutoCAD such as 2004, You will not be able to test the setup you are creating. If there are any errors in what you are doing, It maynot import or show properly in AutoCAD 2007. If this is the case you will be better off creating the toolbars directly through the CUI editor. (See below)

 

I get your point, but isn't it like all programming? Having 1 "space" too many, the thing won't work....

 

You mention to "import a menu (*.mnu) file", it is a hard task. In my case, I just type "menuload" and browse to the desired *.mnu file to load. It shows and works, with all toolbars etc. I don't know what the problem is that you have but I believe it's a fast and reliable way. Tbh: yes, if there is an error inside, it won't load. Nothing shows up and if you do not know how to solve, there's the problem.

 

I don't want to sound like a smart guy, as I said I learn from you, but in this case I am not convinced.

 

Best regards,

MarcoW.

 

btw.: maybe we get the chance of talking to the OP again (seems he's not part of the discussion). Let him try and decide what suit him best. Both ways we'll help along for sure!

Posted
I get your point, but isn't it like all programming? Having 1 "space" too many, the thing won't work....

 

You mention to "import a menu (*.mnu) file", it is a hard task. In my case, I just type "menuload" and browse to the desired *.mnu file to load. It shows and works, with all toolbars etc. I don't know what the problem is that you have but I believe it's a fast and reliable way. Tbh: yes, if there is an error inside, it won't load. Nothing shows up and if you do not know how to solve, there's the problem.

 

I don't want to sound like a smart guy, as I said I learn from you, but in this case I am not convinced.

 

Best regards,

MarcoW.

 

btw.: maybe we get the chance of talking to the OP again (seems he's not part of the discussion). Let him try and decide what suit him best. Both ways we'll help along for sure!

 

Look at this from cad2007's position,

 

To create an mnu or mns and if you have never done it before and you do not have the documentation for it and you are writing it none the less and you are going to load this thing. I hate to be around during the aftermath of it.

Doing it in the manner you suggest could also knock out your ribbon menus that are already loaded or unloaded.

 

What makes you think you are doing this right?

Posted

As promised, cad2007 and balajibth84 have been banned. They are the same person. We do not allow members to have multiple accounts, and this member was warned about this previously.

Posted
As promised, cad2007 and balajibth84 have been banned. They are the same person. We do not allow members to have multiple accounts, and this member was warned about this previously.
If I'm crying, it's only out of joy.
Posted
If I'm crying, it's only out of joy.

 

I am sure he has planned another account already.

 

Just when you thought it was safe to enter the forum!

Posted

What makes you think you are doing this right?

Please take no offence but I am not in the mood for a fight. We just might have other opinions, that should be fine, and we get way out of what the topic was intended for. And for what was it again... oh yeah, the banned one.

"R we cool? 233444smiley_cheers2.gif"

 

As promised, cad2007 and balajibth84 have been banned. They are the same person. We do not allow members to have multiple accounts, and this member was warned about this previously.

It wasn't for the second account only if I am right?

Posted
Please take no offence but I am not in the mood for a fight. We just might have other opinions, that should be fine, and we get way out of what the topic was intended for. And for what was it again... oh yeah, the banned one.

"R we cool? [ATTACH]24482[/ATTACH]"

 

 

It wasn't for the second account only if I am right?

 

I am not trying to start a fight. "Yes we are cool." To put it simply the OP as I mentioned earlier has a language barrier. He will need to rely on his documentation. You are supplying him with information that he most likly has no documention on. For him to reference any of this stuff you are showing he will be lost.

 

By the way that was his third account. You must of missed that thread.

Posted

Can we close this thread?

Posted
Again, if you have nothing constructive to add to a thread, don't post anything at all.

 

Thread Closed.

Guest
This topic is now closed to further replies.
×
×
  • Create New...