Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relink dimensions

Status
Not open for further replies.

adamrbts

Aerospace
Aug 1, 2008
4
Howdy, I have a VBA script to auto-gen CATdrawings using a generic "seed" drawing of several variations of a catalog part.

The drawing views update fine using mylinks.RemoveAllLinks and mylinks.AddLink (oPartProd.ReferenceProduct).

However the dimensions will not update to the new part (even though they stay black, not pink). The drawing thinks it's updated, a force update doesnt work.

What weird thing is if take this drawing and relink the views manually via edit/links... the dimensions magically update.

Anyone have any ideas how to force the dimensions to update via the script..??

cheers
 
Replies continue below

Recommended for you

When you are Removing the links, the Dimensions become Isolated. If you turn on Dimensions Diagnostics (tools, options, mech design, drafting, dimensions), you will see that the dimensions turn blue.
When you replace the links interactively, you are not Removing and Adding links, you are actually replacing those links. Subtle difference, but it maintains the associativity of the dimensions.
 
Thanks Jim, that makes sense. So you do know of a way to maintain the associativity of the links via VBA as opposed to the removing/adding links method..?

Thanks
 
Seems "SaveAs" is your friend. It's a messy alternative but it works.
 
You can also look into Templates. I think you need the PKT/KT1 license, though.

I'm not sure if there is an api that lets you relink a drawing without breaking the links.

It can be problematic when doing this intereactively as well. The dimensions and the view care about the UUID of the parts they are tied to. If you try to relink a veiw to a part with a different UUID, you will get the "Link refused the Document" error, but if you have two parts with the same UUID (which you will get with Save As), you can have problems when using them in the same assembly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor