Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

New VBA Drawing View Labels tool

17 REPLIES 17
Reply
Message 1 of 18
NachitoMax
1058 Views, 17 Replies

New VBA Drawing View Labels tool

Hi,

 

i have made the previously posted code into a small VBA project. Please comment if you find it useful 🙂

 

This tool is for the drawing tab only.

 

Instructions

go to TOOLS tab and click the VBA editor button

rib1.JPG

 

in the VBA editor. go to FILE / Load Project

rib2.JPG

 

Browse to the project and click it to load (you need to save it in this path) 

C:\Users\Public\Documents\Autodesk\Inventor 2013\VBA Addins (mine isnt but your should) 🙂

you should see it in the browser like this

rib3.JPG

 

Click save and close the editor. (when inventor Quits, it may ask you to save changes. Save them.

 

In Inventor, right click on the ribbon tab and select 'Customize user commands..'

rib4.JPG

 

you will get a box like this. 

rib5.JPG

 

select 'Macros' in the top left drop down box

select 'Drawing | Tools' in the top right drop down box

Highlight the Macro called 'DrawingLabels' in the left pane and click the >> button to move it to the right (ribbon)

clict the check boxes like mine (to show text) and then click close.

 

Your button will then appear on the ribbon untder the 'Tools' tab like this

rib6.JPG

 

That should be it.

 

i ask that if you use my tool, you do NOT change the name 'ShawTools' or perceive it as your own tool. 🙂

 

There is a video of the tool here-Drawing Views Video

 

How it works-

 

Click you button to start the tool. it will appear like this-

tool1.JPG

 

Add Scale - when checked, it will include the active scale in the view label. There is also a visual guide under the image on the tool

This Sheet - when clicked (as shown) it will only change the views on the active sheet

All Sheets - when clicked, it will apply the view labels to ALL sheets in the drawing file

 

1/7 - this is a counter 1 being the sheet and 7 being the amount of sheets in the drawing file. you can see on the video that the number increases for every sheet that is selected. This it to give you an idea when it will finish.

 

 

 

 

Enjoy 🙂

 

 

 

Nigel

 

 

 

 

 

 

Thanks

 

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


17 REPLIES 17
Message 2 of 18
GosponZ
in reply to: NachitoMax

Hi

Very nice and descriptive. I do have two or three problems.

1. I do not have that vba addins folder. Is that one you created?

2. I'm on 2012 - is that metter?

3. After i run macro got error

Public Sub SetViewLabels() andCapture.JPG

 

Is it there way to fix i beleive this is good add save a lot time.

Thanks

Message 3 of 18
NachitoMax
in reply to: GosponZ

Hi

You should have a vba addins folder. If you go change the inventor 2013 to 2012 it should be in there. As a second option, open the vba editor and go to file / load project. That should open in the default location. You can drag / copy / paste the file into that location.

If you have any further issues, I'll export them as frm and bas files for you to import into your existing project



Thanks

Nigel

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 4 of 18
GosponZ
in reply to: NachitoMax

 

 

This is what i have i digg everywher but nothing i can find. This is default location.

Thanks for your help

 

 

 

Capture.JPG

Message 5 of 18
NachitoMax
in reply to: GosponZ

Hi

Ok. When you load the project from your current location, do you get any load errors? If not, when it's loaded do you get any run issues prior to closing inventor? My guess is that you are loading the project but because it might not be in the correct place, it doesn't load when inventor opens but the macro is looking for routine to call thius, you will get a project load error.

Goto to tools/application options and click onto the 'files' tab. The default folder location for vba addins should be shown as a path on this tab. Get the path and place the .ivb in there.

Let me know how you get on please 🙂



Nigel

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 6 of 18
GosponZ
in reply to: NachitoMax

Default vba project folder in app. opt is %PUBLICDOCUMENTS%\Autodesk\Inventor 2012\Default.ivb

and i do not have any problem to load project. But when i click run it make error in code as i described above

Message 7 of 18
GosponZ
in reply to: NachitoMax

this is what i have when run

Capture.JPG

Message 8 of 18
NachitoMax
in reply to: GosponZ

Hi

It might be my error.... In the module,there should be a routine that calls the form it should look something like

Frm.DrawingViews Show

The name of that routine is what needs to be added to the menu button. I can't check right now because I'm not at a computer but as a guess, the routine you are calling is looking for form objects that are not there because the form isn't open. Also, this routine only works on drawing sheets.

Let me know how you get on please?



Thanks

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 9 of 18
NachitoMax
in reply to: NachitoMax

Did you get it working?

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 10 of 18
GosponZ
in reply to: NachitoMax

Not yet

Message 11 of 18
NachitoMax
in reply to: GosponZ

Well that is strange. I unloaded my project and reloaded it and it worked fine. Did you find the routine that opened the form? It's in the module. Please look for it and fun it to open the form. Also, in the project double click on the form to expose it in the designer then run it and try the form from there. I'm sure you have the wrong routine on the button 🙂

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 12 of 18
GosponZ
in reply to: NachitoMax

Capture 2.JPGOk this is what i have. I loaded DrawingViews.ivb and than run this is what i have.

 

 

Capture 1.JPGCapture 2.JPG

Message 13 of 18
NachitoMax
in reply to: GosponZ

Hi

 

put this in your MODULE (make sure it doesnt already exist)

 

Public Sub DrawingLabels()
frmDrawingViews.Show
End Sub

 

then in the customize user commands, add the macro called 'DrawingLabels' to the menu. This will call the form and open it. You are getting the error because you are not calling the correct routine. Objects are required from the form and becaise it is not loaded, you get errors.

 

Please try this and get back to me. I have tested this on 3 computers 🙂

 

 

Thanks

 

Nigel

 

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 14 of 18
GosponZ
in reply to: NachitoMax

Do i missing in here? I do not have macro Drawing Views? Should i have ? This macro does nothing? When i click Macro icon on ribbon it happening nothing. Could you post again that ivb please. Something but little is wrong in here. I do have everything you are asking but still error.

Thanks again for your help

Capture 4.JPG

Message 15 of 18
NachitoMax
in reply to: GosponZ

Hi,

 

Unload the project

Restart inventor

Go to the VBA Editor and load project

create a NEW module in your APPLICATION PROJECT and call it MOD_DrawingViewCall

click into the module and paste this

Public Sub DrawingLabels()
frmDrawingViews.Show
End Sub

 

save & close the editor

right click on the menu to customize

the macro named "DrawingLabels" will be visible in the left pane

click it over to the right

 

that should be it. Download the file again from here, its the same as the one i made.

 

That should work just fine 🙂

 

 

 

 

 

Thanks

 

Nigel

 

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 16 of 18
GosponZ
in reply to: NachitoMax

Smiley FrustratedI tried every possible solution but no success, unfortunately. I would like to have fix this one but ...

Message 17 of 18
NachitoMax
in reply to: GosponZ

Hi

I'm happy to remote connect to you so that I can set up up correctly. If you want me to do that, let me know and I'll go through the teamviewer tool.

It will take 2 mins



Thanks

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 18 of 18
GosponZ
in reply to: NachitoMax

Apreciate that but it is controlled by corporate and it is not allowed.:(

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report