Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

**HELP**Macros in assemblies ???

6 REPLIES 6
Reply
Message 1 of 7
otterolly
169 Views, 6 Replies

**HELP**Macros in assemblies ???

Hi

is it possible to make a macro that will run the copy component command when you open up an assembly ??

I want to be able to copy a generic assembly to a new project as a starting point for the new assembly.

Many thanks
6 REPLIES 6
Message 2 of 7
jonbrabbs
in reply to: otterolly

Olly,

Why not save the new assembly with your generic part as a new template with a specific name? Then it'll alway be there for you... Make sure you save it to you default templates folder tho.

Jon
///////////////////////////////////////////////////////////////////////////////////////////////////
If this post helps you, please give kudos.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Message 3 of 7
otterolly
in reply to: otterolly

Hi Jon

thanks for the reply.............I have already done that, just wanted to make it a little easier for people when using the template assembly.

thanks
Message 4 of 7
jonbrabbs
in reply to: otterolly

Olly,

What are you trying to do? Do you want to pattern the assembly along a row or something?

Jon
///////////////////////////////////////////////////////////////////////////////////////////////////
If this post helps you, please give kudos.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Message 5 of 7
otterolly
in reply to: otterolly

Jon

I am in the process of putting together a catalogue of assemblies. I am making a html document that acts as a sort of register where you can pick from a number of different assemblies which are located in a number of different folders. The html document cantains images of the assembly with a link to open the assembly in Inventor (2010) where it opens up read only. I just wanted the copy component command to start up when the assembly is opened up ......kind of to show the draughtsman what to do.

thanks

olly
Message 6 of 7
jonbrabbs
in reply to: otterolly

Olly,

As far as I'm aware, there is no way to copy components within an assembly through code. To get something to fire when the model is opened, you would need to access the events within the code.
Option Explicit

Private WithEvents eFA As ApplicationEvents

Private Sub Class_Initialize()
Set eFA = ThisApplication.ApplicationEvents
End Sub

This code will give you access to the OnOpenDocument event.

In here you could create something that would instruct the user to do something..e.g

sub eFA_OnOpenDocument(ByVal DocumentObject As Document, ByVal FullDocumentName As String, ByVal BeforeOrAfter As EventTimingEnum, ByVal Context As NameValueMap, HandlingCode As HandlingCodeEnum)

MsgBox "Copy Component"

End Sub

This would need to be copied into each file that you wanted it to fire on, and would fire every time it was opened. If you're working on a lot of files, you would be best to create an Addin using VB.Net or the like, which is loaded with Inventor, and is not file specific.

Or you could get it to insert a new instance of the assembly on open, ready to work on - this is something which is fairly straight forward, and I could help you with if you need it.

To get more help with this, I would recommend re-posting in the Inventor Customisation forum, where you will get help from people who do this kind of thing every day.

Jon
///////////////////////////////////////////////////////////////////////////////////////////////////
If this post helps you, please give kudos.
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Message 7 of 7
otterolly
in reply to: otterolly

Jon

thanks for your advice, I thought I could struggle with this.
I will repost in the customisation forum as well

thanks again

olly

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

Post to forums  

Autodesk Design & Make Report