IV10 - OnPartslistChange Event?

IV10 - OnPartslistChange Event?

Anonymous
Not applicable
594 Views
8 Replies
Message 1 of 9

IV10 - OnPartslistChange Event?

Anonymous
Not applicable
I need to trap the event when something changes in the partslist.
I could not find anything usefull in the OnDocumentChange Event which would
tell me that the partslist has changed.

Anyone?

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--
0 Likes
595 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable
What about writing an OnDocumentChange event sink for the document that
the Parts List references?

On Wed, 14 Dec 2005 14:10:39 +0000, Teum Ham wrote:

> I need to trap the event when something changes in the partslist. I could
> not find anything usefull in the OnDocumentChange Event which would tell
> me that the partslist has changed.
0 Likes
Message 3 of 9

Anonymous
Not applicable
Hi Brian,

I am not sure how that would help me when, for example, the user re-orders
and re-numbers the partslist. The partslist would change, but the referenced
part/assembly does not change.

If you want to know what I am up to, read this topic:
http://www.mcadforums.com/forums/viewtopic.php?t=4272

Thanks!

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Brian Iwaskewycz" wrote in
message news:5037643@discussion.autodesk.com...
What about writing an OnDocumentChange event sink for the document that
the Parts List references?

On Wed, 14 Dec 2005 14:10:39 +0000, Teum Ham wrote:

> I need to trap the event when something changes in the partslist. I could
> not find anything usefull in the OnDocumentChange Event which would tell
> me that the partslist has changed.
0 Likes
Message 4 of 9

Anonymous
Not applicable
Teun,

In the OnDocumentChange event for the drawing document, the Context argument
reports the "InternalName" of such a change as "EditPartList". So, a change
to any parts list will report this - however, the event doesn't tell you
which parts list changed. You'll need to add some logic to figure that.
Also, this event would fire on the drawing document only when the user
performs an explicit edit to the parts list. The event will not fire when
the parts list updates due to model changes. You'll need to listen to the
changes on the model document to trap those changes.

Sanjay-

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5037669@discussion.autodesk.com...
Hi Brian,

I am not sure how that would help me when, for example, the user re-orders
and re-numbers the partslist. The partslist would change, but the referenced
part/assembly does not change.

If you want to know what I am up to, read this topic:
http://www.mcadforums.com/forums/viewtopic.php?t=4272

Thanks!

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Brian Iwaskewycz" wrote in
message news:5037643@discussion.autodesk.com...
What about writing an OnDocumentChange event sink for the document that
the Parts List references?

On Wed, 14 Dec 2005 14:10:39 +0000, Teum Ham wrote:

> I need to trap the event when something changes in the partslist. I could
> not find anything usefull in the OnDocumentChange Event which would tell
> me that the partslist has changed.
0 Likes
Message 5 of 9

Anonymous
Not applicable
Ok, so here's my next problem...(and I run into this yesterday)

I wanted to see what the "Event Context Information" can do, but when I
clicked the link I got an error "The page cannot be displayed".
It seems like this is missing in the Help file!

******
NameValueMap Collection
Description
The NameValueMap object.For more information, see Event Context Information.
<--CLICK HERE

For a list of all members defined in this module, see NameValueMap members.

See Also
NameValueMap Members

*****

What to do?

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5037935@discussion.autodesk.com...
Teun,

In the OnDocumentChange event for the drawing document, the Context argument
reports the "InternalName" of such a change as "EditPartList". So, a change
to any parts list will report this - however, the event doesn't tell you
which parts list changed. You'll need to add some logic to figure that.
Also, this event would fire on the drawing document only when the user
performs an explicit edit to the parts list. The event will not fire when
the parts list updates due to model changes. You'll need to listen to the
changes on the model document to trap those changes.

Sanjay-

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5037669@discussion.autodesk.com...
Hi Brian,

I am not sure how that would help me when, for example, the user re-orders
and re-numbers the partslist. The partslist would change, but the referenced
part/assembly does not change.

If you want to know what I am up to, read this topic:
http://www.mcadforums.com/forums/viewtopic.php?t=4272

Thanks!

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Brian Iwaskewycz" wrote in
message news:5037643@discussion.autodesk.com...
What about writing an OnDocumentChange event sink for the document that
the Parts List references?

On Wed, 14 Dec 2005 14:10:39 +0000, Teum Ham wrote:

> I need to trap the event when something changes in the partslist. I could
> not find anything usefull in the OnDocumentChange Event which would tell
> me that the partslist has changed.
0 Likes
Message 6 of 9

Anonymous
Not applicable
I have attached a screenshot of my MatchBallon Addin.

I am only watching the OnDocumentChange Event, trying to figure out how many
"InternalNames" there are
But it seems like the OnDocumentChange Event is being fired even if there
is not an actual change.

For example:
If you would edit a Partslist and hit Cancel, the OnDocumentChange Event is
not fired.
If you would edit a Partslist and hit OK (without changing anything), the
OnDocumentChange Event is fired!!!

The same applies for Text, View Labels, etc.

Is this by design?

And another issue:
In my code, I am using "Item(3)" to get to the InternalName...This code will
fail when I exit a sketch (from the Part Environment), because there
"Item(3)" does not exist (see second picture). The InternalName is now
Item(2). (At least, that's what I assume)

How can I be sure that I get the InternalName?

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5038538@discussion.autodesk.com...
Ok, so here's my next problem...(and I run into this yesterday)

I wanted to see what the "Event Context Information" can do, but when I
clicked the link I got an error "The page cannot be displayed".
It seems like this is missing in the Help file!

******
NameValueMap Collection
Description
The NameValueMap object.For more information, see Event Context Information.
<--CLICK HERE

For a list of all members defined in this module, see NameValueMap members.

See Also
NameValueMap Members

*****

What to do?

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5037935@discussion.autodesk.com...
Teun,

In the OnDocumentChange event for the drawing document, the Context argument
reports the "InternalName" of such a change as "EditPartList". So, a change
to any parts list will report this - however, the event doesn't tell you
which parts list changed. You'll need to add some logic to figure that.
Also, this event would fire on the drawing document only when the user
performs an explicit edit to the parts list. The event will not fire when
the parts list updates due to model changes. You'll need to listen to the
changes on the model document to trap those changes.

Sanjay-

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5037669@discussion.autodesk.com...
Hi Brian,

I am not sure how that would help me when, for example, the user re-orders
and re-numbers the partslist. The partslist would change, but the referenced
part/assembly does not change.

If you want to know what I am up to, read this topic:
http://www.mcadforums.com/forums/viewtopic.php?t=4272

Thanks!

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Brian Iwaskewycz" wrote in
message news:5037643@discussion.autodesk.com...
What about writing an OnDocumentChange event sink for the document that
the Parts List references?

On Wed, 14 Dec 2005 14:10:39 +0000, Teum Ham wrote:

> I need to trap the event when something changes in the partslist. I could
> not find anything usefull in the OnDocumentChange Event which would tell
> me that the partslist has changed.
0 Likes
Message 7 of 9

Anonymous
Not applicable
For some reason, the attachments are only visible at the HTTP side:
http://discussion.autodesk.com/thread.jspa?messageID=5037643

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5038695@discussion.autodesk.com...
I have attached a screenshot of my MatchBallon Addin.

I am only watching the OnDocumentChange Event, trying to figure out how many
"InternalNames" there are
But it seems like the OnDocumentChange Event is being fired even if there
is not an actual change.

For example:
If you would edit a Partslist and hit Cancel, the OnDocumentChange Event is
not fired.
If you would edit a Partslist and hit OK (without changing anything), the
OnDocumentChange Event is fired!!!

The same applies for Text
, View Labels, etc.

Is this by design?

And another issue:
In my code, I am using "Item(3)" to get to the InternalName...This code will
fail when I exit a sketch (from the Part Environment), because there
"Item(3)" does not exist (see second picture). The InternalName is now
Item(2). (At least, that's what I assume)

How can I be sure that I get the InternalName?

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Drive
r = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5038538@discussion.autodesk.com...
Ok, so here's my next problem...(and I run into this yesterday)

I wanted to see what the "Event Context Information" can do, but when I
clicked the link I got an error "The page cannot be displayed".

It seems like this is missing in the Help file!

******
NameValueMap Collection
Description
The NameValueMap object.For more information, see Event Context Informatio
0 Likes
Message 8 of 9

Anonymous
Not applicable
Teun,

Instead of using an index to access the internal name entry, use the
"InternalName" string for the NameValueMap. Something like:

If Context.Value("InternalName") = "EditPartList" Then
...
...

At times, the value returned here will be "CompositeChange", in which case
the Context argument will have another entry "InternalNameList" which
contains all the individual changes of the composite.

Regarding your question of the event firing even when you haven't made any
changes, this event will fire any time an entry is added to the Undo stack
(so regardless of whether you changed any values or not, the change may have
been executed).

Sanjay-




"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5038695@discussion.autodesk.com...
I have attached a screenshot of my MatchBallon Addin.

I am only watching the OnDocumentChange Event, trying to figure out how many
"InternalNames" there are
But it seems like the OnDocumentChange Event is being fired even if there
is not an actual change.

For example:
If you would edit a Partslist and hit Cancel, the OnDocumentChange Event is
not fired.
If you would edit a Partslist and hit OK (without changing anything), the
OnDocumentChange Event is fired!!!

The same applies for Text
, View Labels, etc.

Is this by design?

And another issue:
In my code, I am using "Item(3)" to get to the InternalName...This code will
fail when I exit a sketch (from the Part Environment), because there
"Item(3)" does not exist (see second picture). The InternalName is now
Item(2). (At least, that's what I assume)

How can I be sure that I get the InternalName?

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Drive
r = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5038538@discussion.autodesk.com...
Ok, so here's my next problem...(and I run into this yesterday)

I wanted to see what the "Event Context Information" can do, but when I
clicked the link I got an error "The page cannot be displayed".

It seems like this is missing in the Help file!

******
NameValueMap Collection
Description
The NameValueMap object.For more information, see Event Context Informatio
0 Likes
Message 9 of 9

Anonymous
Not applicable
Thanks for the info Sanjay!

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Sanjay Ramaswamy (Autodesk)" wrote in
message news:5039115@discussion.autodesk.com...
Teun,

Instead of using an index to access the internal name entry, use the
"InternalName" string for the NameValueMap. Something like:

If Context.Value("InternalName") = "EditPartList" Then
...
...

At times, the value returned here will be "CompositeChange", in which case
the Context argument will have another entry "InternalNameList" which
contains all the individual changes of the composite.

Regarding your question of the event firing even when you haven't made any
changes, this event will fire any time an entry is added to the Undo stack
(so regardless of whether you changed any values or not, the change may have
been executed).

Sanjay-




"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5038695@discussion.autodesk.com...
I have attached a screenshot of my MatchBallon Addin.

I am only watching the OnDocumentChange Event, trying to figure out how many
"InternalNames" there are
But it seems like the OnDocumentChange Event is being fired even if there
is not an actual change.

For example:
If you would edit a Partslist and hit Cancel, the OnDocumentChange Event is
not fired.
If you would edit a Partslist and hit OK (without changing anything), the
OnDocumentChange Event is fired!!!

The same applies for Text
, View Labels, etc.

Is this by design?

And another issue:
In my code, I am using "Item(3)" to get to the InternalName...This code will
fail when I exit a sketch (from the Part Environment), because there
"Item(3)" does not exist (see second picture). The InternalName is now
Item(2). (At least, that's what I assume)

How can I be sure that I get the InternalName?

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Drive
r = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP2
--

"Teun Ham (IV9 SP4 / IV10 SP2)"
wrote in message news:5038538@discussion.autodesk.com...
Ok, so here's my next problem...(and I run into this yesterday)

I wanted to see what the "Event Context Information" can do, but when I
clicked the link I got an error "The page cannot be displayed".

It seems like this is missing in the Help file!

******
NameValueMap Collection
Description
The NameValueMap object.For more information, see Event Context Informatio
0 Likes