ActiveEditDocument.GraphicsDataSetsCollection.Add2

ActiveEditDocument.GraphicsDataSetsCollection.Add2

mikazakov
Advocate Advocate
754 Views
2 Replies
Message 1 of 3

ActiveEditDocument.GraphicsDataSetsCollection.Add2

mikazakov
Advocate
Advocate

Hi,

Xiaodong Liang wrote the article:

http://adndevblog.typepad.com/manufacturing/2012/06/save-clientgraphics-information-along-with-the-d...

But, method:

 

GraphicsDataSetsCollection.Add2 

 

return exception

Why?  Xiaodong Yang joked?

 

Sub Test()
Dim doc As PartDocument
Set doc = ThisApplication.ActiveEditDocument
Dim GetGUID As String

GetGUID = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2, 36)

Dim oGraphicsData As GraphicsDataSets
  
Set oGraphicsData = ThisApplication.ActiveEditDocument.GraphicsDataSetsCollection.Add2(GetGUID, True)

End Sub
0 Likes
Accepted solutions (1)
755 Views
2 Replies
Replies (2)
Message 2 of 3

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

I wrote the blog long time ago, testing with old releases. While in the latest Inventor, the Add2 method is re-defined as _Add2.  And this is a hidden method, you need to switch on [show hidden methods] of object browser to see it. So, in VBA, the code could be as below. I will update that blog. 

 

Thanks for soptting this.

 

Sub Test()
Dim doc As PartDocument
Set doc = ThisApplication.ActiveEditDocument
Dim GetGUID As String

GetGUID = Mid$(CreateObject("Scriptlet.TypeLib").GUID, 2, 36)

Dim oGraphicsData As GraphicsDataSets

Set oGraphicsData = ThisApplication.ActiveDocument.GraphicsDataSetsCollection.[_Add2](GetGUID, True)
End Sub

 

Message 3 of 3

mikazakov
Advocate
Advocate
Thank you for your answer.
0 Likes