Can't find Workpoint first time 2017

Can't find Workpoint first time 2017

rikard.nilsson
Collaborator Collaborator
278 Views
1 Reply
Message 1 of 2

Can't find Workpoint first time 2017

rikard.nilsson
Collaborator
Collaborator

Hi,

 

I have a very strange problem with getting workpoints in a part.

 

If you open my attacehd assembly it will give you an error because I set my rule to run AfterOpen.

But if you then run the rule manually it will give a messagebox for every Workpoint in the part (Center Point and WPTest)

 

It always find the Document but fails in the row with 

Document1.ComponentDefinition.WorkPoints

 

Why is that?

Is there any way to make the code to work after open?

 

Regards

Rikard

0 Likes
Accepted solutions (1)
279 Views
1 Reply
Reply (1)
Message 2 of 2

rikard.nilsson
Collaborator
Collaborator
Accepted solution

 

Hi,

 

Directly after posting I think I found the answer myself..

 

Document1 has to be PartDocument or AssemblyDocument then it works..

 

/Rikard

0 Likes