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: 

Is there an "on selecting document" command?

12 REPLIES 12
Reply
Message 1 of 13
Anonymous
477 Views, 12 Replies

Is there an "on selecting document" command?

Ie. is it possible to detect when a new document is selected or loaded?
This would allow for the type of document tested, (ie. part, assembly,
drawing, etc.) so that appropriate "tools" can be made available.

Thanks,

EdT
12 REPLIES 12
Message 2 of 13
Anonymous
in reply to: Anonymous

Sounds like you need one or more of the Events such as OnActivate or onFileOpen.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Ed Thompson" wrote in message
news:B58559EC81FFD4E282971BA15A6A0AC6@in.WebX.maYIadrTaRb...
> Ie. is it possible to detect when a new document is selected or loaded?
> This would allow for the type of document tested, (ie. part, assembly,
> drawing, etc.) so that appropriate "tools" can be made available.
>
> Thanks,
>
> EdT
>
>
Message 3 of 13
Anonymous
in reply to: Anonymous

Thanks Kent,

Looks like these are exactly what I was looking for. Do you know of any
examples that use these? It seems like most subs first check that a
document is of the correct "type" before a routine can continue, (probably
because they are stand alone samples). Has anyone used the "on select
document" to "allow" which tools and buttons are available for each type of
document? If so, does this approach work?

EdT



"Kent Keller" wrote in message
news:676E67A50B3BFF469546110B4BA2956A@in.WebX.maYIadrTaRb...
> Sounds like you need one or more of the Events such as OnActivate or
onFileOpen.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Ed Thompson" wrote in message
> news:B58559EC81FFD4E282971BA15A6A0AC6@in.WebX.maYIadrTaRb...
> > Ie. is it possible to detect when a new document is selected or loaded?
> > This would allow for the type of document tested, (ie. part, assembly,
> > drawing, etc.) so that appropriate "tools" can be made available.
> >
> > Thanks,
> >
> > EdT
> >
> >
>
>
Message 4 of 13
Anonymous
in reply to: Anonymous

On 4-14-03 Brian Ekins posted a example of the OnAssemblyChange event with a subject
"OnAssemblyChanged Event Sample" Shouldn't be much difference in setting up the other
events I wouldn't think.

Doesn't the standard toolbar customization allow what you want already though? Right
click in a toolbar and choose Customize. Then in the first tab set up what toolbars are
shown in the various Environments.

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Ed Thompson" wrote in message
news:1C61D8E961A5202FB0369579265345DC@in.WebX.maYIadrTaRb...
> Thanks Kent,
>
> Looks like these are exactly what I was looking for. Do you know of any
> examples that use these? It seems like most subs first check that a
> document is of the correct "type" before a routine can continue, (probably
> because they are stand alone samples). Has anyone used the "on select
> document" to "allow" which tools and buttons are available for each type of
> document? If so, does this approach work?
>
> EdT
Message 5 of 13
Anonymous
in reply to: Anonymous

Kent,

I have been so busy trying to get the different "tools" to work, I haven't
thought much about adding my tools to the standard toolbars. So, far all I
have is a little VB form that floats around with lots of buttons on it. I
was thinking of "graying out" the buttons as would be appropriate. Is there
much of an advantage to place "tools" into the standard toolbar?

Ed

"Kent Keller" wrote in message
news:8EB4C7A12E29103ED1FA349186F09DD2@in.WebX.maYIadrTaRb...
> On 4-14-03 Brian Ekins posted a example of the OnAssemblyChange event with
a subject
> "OnAssemblyChanged Event Sample" Shouldn't be much difference in setting
up the other
> events I wouldn't think.
>
> Doesn't the standard toolbar customization allow what you want already
though? Right
> click in a toolbar and choose Customize. Then in the first tab set up
what toolbars are
> shown in the various Environments.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Ed Thompson" wrote in message
> news:1C61D8E961A5202FB0369579265345DC@in.WebX.maYIadrTaRb...
> > Thanks Kent,
> >
> > Looks like these are exactly what I was looking for. Do you know of any
> > examples that use these? It seems like most subs first check that a
> > document is of the correct "type" before a routine can continue,
(probably
> > because they are stand alone samples). Has anyone used the "on select
> > document" to "allow" which tools and buttons are available for each type
of
> > document? If so, does this approach work?
> >
> > EdT
>
>
Message 5 of 13
Anonymous
in reply to: Anonymous

Kent,

Which news group is this on. I tried this one and can't seem to find the
entry. I searched for the date, the person and the topic.

Thanks,

Ed


"Kent Keller" wrote in message
news:8EB4C7A12E29103ED1FA349186F09DD2@in.WebX.maYIadrTaRb...
> On 4-14-03 Brian Ekins posted a example of the OnAssemblyChange event with
a subject
> "OnAssemblyChanged Event Sample" Shouldn't be much difference in setting
up the other
> events I wouldn't think.
>
> Doesn't the standard toolbar customization allow what you want already
though? Right
> click in a toolbar and choose Customize. Then in the first tab set up
what toolbars are
> shown in the various Environments.
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Ed Thompson" wrote in message
> news:1C61D8E961A5202FB0369579265345DC@in.WebX.maYIadrTaRb...
> > Thanks Kent,
> >
> > Looks like these are exactly what I was looking for. Do you know of any
> > examples that use these? It seems like most subs first check that a
> > document is of the correct "type" before a routine can continue,
(probably
> > because they are stand alone samples). Has anyone used the "on select
> > document" to "allow" which tools and buttons are available for each type
of
> > document? If so, does this approach work?
> >
> > EdT
>
>
Message 7 of 13
Anonymous
in reply to: Anonymous

Ed -

I had a hard time finding it also! Brian posted under the name of
"Autodesk" which is why a search by his name didn't show up the
file. It is in Customer Files with the information as below.


Topic: OnAssemblyChanged Event Sample Message: 1 of 1

From: Autodesk\
Date: Apr/14/03 - 21:23 (GMT)
Sample for Inventor's API OnAssemblyChanged event.

Attachments: AsmChanged.zip

---
Anne Brown
Manager, Moderator
Autodesk Product Support Discussion Groups
Discussion Q&A: http://www.autodesk.com/discussion



Ed Thompson wrote:
>
> Kent,
>
> Which news group is this on. I tried this one and can't seem to find the
> entry. I searched for the date, the person and the topic.
Message 8 of 13
Anonymous
in reply to: Anonymous

Sorry about that, should have said which group it was in 8^)

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Anne Brown" wrote in message
news:3EC0EA8C.1947DFF7@autodesk.com...
> Ed -
>
> I had a hard time finding it also! Brian posted under the name of
>
> Ed Thompson wrote:
> >
> > Kent,
> >
> > Which news group is this on.
Message 8 of 13
Anonymous
in reply to: Anonymous

I have tried to reset and to renown load but I can't seem to get any files
before 4/21/03 for the "inventor"customer-files"? Any idea what I am
missing.... I just can't seem to find this file

EdT


"Anne Brown" wrote in message
news:3EC0EA8C.1947DFF7@autodesk.com...
> Ed -
>
> I had a hard time finding it also! Brian posted under the name of
> "Autodesk" which is why a search by his name didn't show up the
> file. It is in Customer Files with the information as below.
>
>
> Topic: OnAssemblyChanged Event Sample Message: 1 of 1
>
> From: Autodesk\
> Date: Apr/14/03 - 21:23 (GMT)
> Sample for Inventor's API OnAssemblyChanged event.
>
> Attachments: AsmChanged.zip
>
> ---
> Anne Brown
> Manager, Moderator
> Autodesk Product Support Discussion Groups
> Discussion Q&A: http://www.autodesk.com/discussion
>
>
>
> Ed Thompson wrote:
> >
> > Kent,
> >
> > Which news group is this on. I tried this one and can't seem to find
the
> > entry. I searched for the date, the person and the topic.
Message 10 of 13
Anonymous
in reply to: Anonymous

Well if Kent or I would be more specific, it would help you a lot
<--a grin Kent!

It is in the general Customer Files, not in the new one
specifically for Inventor.

CUSTOMER-FILES
Customer Files (CF) is an area for upload of problem files for
review or sharing. Users are asked to zip any files prior to
uploading to conserve download time and server space.

For NNTP newsgroup readers the Customer-files newsgroup can be
found at
news://discussion.autodesk.com/autodesk.autocad.customer-files.

You may also access the customer-files group via the HTTP
web-based forums at
http://discussion.autodesk.com/WebX?14@@.ee940b5.
--
Anne Brown
Manager, Moderator
Autodesk Product Support Discussion Groups
Discussion Q&A: http://www.autodesk.com/discussion


Ed Thompson wrote:
>
> I have tried to reset and to renown load but I can't seem to get any files
> before 4/21/03 for the "inventor"customer-files"? Any idea what I am
> missing.... I just can't seem to find this file
Message 11 of 13
Anonymous
in reply to: Anonymous

I will go one further <----a Very Big Grin Anne

Try this

http://makeashorterlink.com/?K29752D84

--
Kent
Assistant Moderator
Autodesk Discussion Forum Moderator Program


"Anne Brown" wrote in message
news:3EC139C8.38EBF4DB@autodesk.com...
> Well if Kent or I would be more specific, it would help you a lot
> <--a grin Kent!
Message 12 of 13
Anonymous
in reply to: Anonymous

Thanks for you help, I finally found it. But, I am a bit confused, (nothing
unusual about that). I would like to be able to detect when a document
inside of Inventor is changed. I had a program running, which of course
checked if there was an assembly open and all worked fine. However, I
closed the assembly, and happened to see what would happen if I tried the
program again and the result is an error, (actually there was no Inventor
document open but Inventor was still running and my macro was still
running)..

It seems like the best way to prevent this is to have a "master routine"
which detects what the active document type is and to disable or enable
buttons accordingly. This could actually be pretty clean. Another
potential situation is to open a part file while in an assembly.

Thanks,

EdT



"Kent Keller" wrote in message
news:2E446DF4EC16858D0EEEAD4CBFFD6064@in.WebX.maYIadrTaRb...
> I will go one further <----a Very Big Grin Anne
>
> Try this
>
> http://makeashorterlink.com/?K29752D84
>
> --
> Kent
> Assistant Moderator
> Autodesk Discussion Forum Moderator Program
>
>
> "Anne Brown" wrote in message
> news:3EC139C8.38EBF4DB@autodesk.com...
> > Well if Kent or I would be more specific, it would help you a lot
> > <--a grin Kent!
>
>
Message 13 of 13
peter12
in reply to: Anonymous

Hello!

i want also download the example for the assembly change event, but get always a "page not found"
use inv 8

please help me

regards peter

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

Post to forums  

Autodesk Design & Make Report