Get the linked document from drawing view (Drafting)
Get the linked document from drawing view (Drafting)
(OP)
Hi,
I've a view (generative view) linked to a product
Im trying to open this Product Document from the generated view.
Note: view is generated from one of the Enhanced Scene.
Product Tree Structure is as below:
|- Product
|- Part1
|
|
|-Applications
|- Scenes
|-Scene.1
When i use the following method it fails -
Set oLinkReferenceProduct = View.GenerativeBehavior.Document '--------> Works gives back the scene.1
Set oLinkReferenceProductParent = oLinkReferenceProduct.Parent '-----------> Gives Scenes Collection
Set oDocLinked = oLinkReferenceProductParent.Parent '-----------> ' Returns object i.e Technological object.
Set oDoc =oDocLinked.Parent '--------------------> Fails
or
Set oLink = oView.GenerativeLinks.FirstLink --------> Works gives back the scene.1
Set oLinkParent = oLink.Parent --------> Works gives back the Scenes
Set oLinkParentParent = oLinkParent.Parent ------> Gives back object i.e Technological object.
My question is how to get the parent document through view in this case?
Hope to get a valuable feedback on how to go ahead.
Regards,
Maddy
I've a view (generative view) linked to a product
Im trying to open this Product Document from the generated view.
Note: view is generated from one of the Enhanced Scene.
Product Tree Structure is as below:
|- Product
|- Part1
|
|
|-Applications
|- Scenes
|-Scene.1
When i use the following method it fails -
Set oLinkReferenceProduct = View.GenerativeBehavior.Document '--------> Works gives back the scene.1
Set oLinkReferenceProductParent = oLinkReferenceProduct.Parent '-----------> Gives Scenes Collection
Set oDocLinked = oLinkReferenceProductParent.Parent '-----------> ' Returns object i.e Technological object.
Set oDoc =oDocLinked.Parent '--------------------> Fails
or
Set oLink = oView.GenerativeLinks.FirstLink --------> Works gives back the scene.1
Set oLinkParent = oLink.Parent --------> Works gives back the Scenes
Set oLinkParentParent = oLinkParent.Parent ------> Gives back object i.e Technological object.
My question is how to get the parent document through view in this case?
Hope to get a valuable feedback on how to go ahead.
Regards,
Maddy





RE: Get the linked document from drawing view (Drafting)
Something like this (you need to have a drawing view activated, is not working for unfolded views) ?
CODE --> CATScript
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Get the linked document from drawing view (Drafting)
Thanks for reply,
Tried with you code but still getting the same error as earlier (attached error snap and links for reference).
Somehow i wasn't able to get the document link from the view so that i can open the document thro' macro.
Regards,
Maddy
RE: Get the linked document from drawing view (Drafting)
Thanks for reply,
Tried with you code but still getting the same error as earlier (attached error snap and links for reference).
Somehow i wasn't able to get the document link from the view so that i can open the document thro' macro.
Regards,
Maddy
RE: Get the linked document from drawing view (Drafting)
Got the solution.
Upon restart both methods works and think some thing in memory was obstructing the method.
Set oDocLinked = drawingView1.GenerativeBehavior.document.ReferenceProduct.Parent '(Works when link points to model directly)
Set oDocLinked = drawingView1.GenerativeBehavior.document.Parent.Parent '(Works when link points to a Scene)
Sometimes mind gets nowhere.....
Regards,
Maddy.