how does I get the title and subject properties?

how does I get the title and subject properties?

Darkforce_the_ilogic_guy
Advisor Advisor
238 Views
1 Reply
Message 1 of 2

how does I get the title and subject properties?

Darkforce_the_ilogic_guy
Advisor
Advisor

how do i read the title and Subject like i read desciption in my code ?

 

Class BOMEXport
	
Shared oHoleRepportExcel As String

Private oBrowserpane As BrowserPane
	Private AssFeats As New List(Of String)
	Private PartFeats As New List(Of String)
	Shared PartNumberOfParents As String
	Shared PartNumberOfParents2 As String

Sub main()
	
	Dim docForSubtype = ThisDoc.Document
	Dim sDocumentSubType As String = docForSubtype.SubType
If sDocumentSubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Or sDocumentSubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}" Or sDocumentSubType = "{BBF9FDF1-52DC-11D0-8C04-0800090BE8EC}" Then
	MessageBox.Show("files type not supportede", "Title")

Exit Sub 
End If 
	oHoleRepportExcel =""


	PossibleIssueReport()


End Sub



Sub PossibleIssueReport()

Dim oDoc As AssemblyDocument
oDoc = ThisApplication.ActiveDocument

Dim oBOM As BOM
oBOM = oDoc.ComponentDefinition.BOM

oBOM.StructuredViewEnabled = True
oBOM.StructuredViewFirstLevelOnly = False
oBOM.StructuredViewDelimiter = "."

oBOM.PartsOnlyViewEnabled = True

Dim oBOMView As BOMView
oBOMView = oBOM.BOMViews.Item("Structured")
debug("Call ExportToExcel")
Call ExportToExcel(oBOMView.BOMRows)

'Add To Clipboard(Copy & past fuction)

Clipboard.SetText(oHoleRepportExcel)		
End Sub


Public Sub debug(txt As String)
	Trace.WriteLine("NTI : " & txt)
End Sub

Public Function ExportToExcel(brows As BOMRowsEnumerator)
	
Dim brow As BOMRow

For Each brow In brows
	
	
Dim rDoc As Document
rDoc = brow.ComponentDefinitions.Item(1).Document
debug("Error after next")
Dim docPropertySet As PropertySet
docPropertySet = rDoc.PropertySets.Item("Design Tracking Properties")


Dim docPropertySet1 As PropertySet

docPropertySet1 = rDoc.PropertySets.Item("User Defined Properties")


If Not brow.ChildRows Is Nothing
	If docPropertySet.Item("Document SubType Name").Value <> "Part" Then
		
End If
Try



Catch
	MsgBox("Fail")
End Try
	oHoleRepportExcel = oHoleRepportExcel & docPropertySet.Item("Part Number").Value &  "	" & docPropertySet.Item("Description").Value &  "	" & "Title"&  "	" & "Subject" &  vbLf 
	'Subject
	Call ExportToExcel(brow.ChildRows)
End If

	
 oHoleRepportExcel = oHoleRepportExcel & docPropertySet.Item("Part Number").Value &  "	" & docPropertySet.Item("Description").Value &  "	" & "Title" &  "	" & "Subject" &  vbLf 
 

Next


End Function

End Class

 

 

 

 

 

 

 

0 Likes
239 Views
1 Reply
Reply (1)
Message 2 of 2

Frederick_Law
Mentor
Mentor

This will write out full list of all iProperties to Info log.

For some reason, some display name and code name are not the same.

 

Sub Main()
Dim oPropsets As PropertySets
Dim oPropset As PropertySet
Dim oProp As Inventor.Property
Dim oDoc As Document

oDoc = ThisDoc.Document
oPropsets = oDoc.PropertySets

For Each oPropset In oPropsets
	Logger.Info("+" & oPropset.DisplayName)
	Logger.Info("-" & oPropset.Name)
	For Each oProp In oPropset
		Logger.Info(" +" & oProp.DisplayName)
		Logger.Info(" -" & oProp.Name)
	Next
Next
'oPropset = oPropsets.Item("Design Tracking Properties")
'Logger.Info(oPropset.Item("Creation Time").Value.ToString)
'oPropset.Item("Creation Time").Value = Now
End Sub

 

0 Likes