Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hej hej,
i am trying in VBA to uncheck the "Date checked" box in the iproperties in a drawing and at the same time in its main assembly or main part.
I have the following code that works for the active document itself:
' Get the active document. Dim oDoc As Document Set oDoc = ThisApplication.ActiveDocument ' Get the PropertySets object. Dim oPropSets As PropertySets Set oPropSets = oDoc.PropertySets ' Get the design tracking property set. Dim oPropSet As PropertySet 'Set oPropSet = oPropSets.Item("Design Tracking Properties") oPropSets.Item("Design Tracking Properties").Item("Date Checked").Value = "01.01.1601 01:00:00"
Now i am trying to get the main assembly or part from the drawing and change it as well, but i cant get it together...
I found this code that seems to point me in the right direction. I don't need to open the main assembly but change the "date checked" property.
Dim oDwgDoc As DrawingDocument Set oDwgDoc = ThisApplication.ActiveDocument Dim oSheet As Sheet Dim oDrawingView As DrawingView Dim oModelDoc As Document For Each oSheet In oDwgDoc.Sheets oSheet.Activate Set oDrawingView = oSheet.DrawingViews.Item(1) Set oModelDoc = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument Call ThisApplication.Documents.Open(oModelDoc.FullDocumentName, True) ' False for invisbly opened Next
Can anyone help me out with this or point me into the right direction?
Solved! Go to Solution.