Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

export part iproperties description value while in the drawing document????

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
272 Views, 2 Replies

export part iproperties description value while in the drawing document????

Anonymous
Not applicable
I have a title block property that feeds off of the model property description. I want to export that to an .txt file is this possible without opening the part itself. Please help as I am a newbie to this I am not sure how. Below is what I have started with but I know its not correct unless I have the part open. I am wonder if I can avoid opening the part and or can I extract it from the title block definition. Sorry I am newb to VBA but learning fast. Really stuck on this one PLEASE PLEASE HELP. Thanks

Sub SinglePart()

Dim oDrawingDoc As DrawingDocument
Set oDrawingDoc = ThisApplication.ActiveDocument

Dim oPartdoc As PartDocument
Set oPartdoc = ThisApplication.ActivePart (HELP!)

Dim oPartDesc As Property
Set oPartDesc = oPartdoc.PropertySets.Item("Design Tracking Properties").Item("Description")

Set fs1 = CreateObject("Scripting.FileSystemObject")
Set a1 = fs1.CreateTextFile("c:\autosave\bomgen\bomgenAI.txt", True)
a1.WriteLine (oPartDesc.Value)
a1.Close



End Sub?????
0 Likes

export part iproperties description value while in the drawing document????

I have a title block property that feeds off of the model property description. I want to export that to an .txt file is this possible without opening the part itself. Please help as I am a newbie to this I am not sure how. Below is what I have started with but I know its not correct unless I have the part open. I am wonder if I can avoid opening the part and or can I extract it from the title block definition. Sorry I am newb to VBA but learning fast. Really stuck on this one PLEASE PLEASE HELP. Thanks

Sub SinglePart()

Dim oDrawingDoc As DrawingDocument
Set oDrawingDoc = ThisApplication.ActiveDocument

Dim oPartdoc As PartDocument
Set oPartdoc = ThisApplication.ActivePart (HELP!)

Dim oPartDesc As Property
Set oPartDesc = oPartdoc.PropertySets.Item("Design Tracking Properties").Item("Description")

Set fs1 = CreateObject("Scripting.FileSystemObject")
Set a1 = fs1.CreateTextFile("c:\autosave\bomgen\bomgenAI.txt", True)
a1.WriteLine (oPartDesc.Value)
a1.Close



End Sub?????
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
Dear friend,

use following code for getting property without opening file

Dim servercom As New Inventor.ApprenticeServerComponent
Dim serverDoc As Inventor.ApprenticeServerDocument
serverDoc = servercom.Open("C:\Cylindrical.ipt")
Dim count As Integer = serverDoc.PropertySets.Count
Dim i As Integer = 0
For i = 1 To count
Dim Propset As PropertySet = serverDoc.PropertySets(i)
Next

Regards,
Satyajeet
0 Likes

Dear friend,

use following code for getting property without opening file

Dim servercom As New Inventor.ApprenticeServerComponent
Dim serverDoc As Inventor.ApprenticeServerDocument
serverDoc = servercom.Open("C:\Cylindrical.ipt")
Dim count As Integer = serverDoc.PropertySets.Count
Dim i As Integer = 0
For i = 1 To count
Dim Propset As PropertySet = serverDoc.PropertySets(i)
Next

Regards,
Satyajeet
Message 3 of 3
Anonymous
in reply to: Anonymous

Anonymous
Not applicable
THANK YOU SO MUCH with a little tweaks I got this to grab the property I wanted. I hate to ask but since I am a newbie I have to. Is there a way to grab the full part file path inside of the drawing if so how? I would also like to grab a sheet property specifically the sheet number property and how would I achieve that. Thanks again and I appreciate all the help you can give me.
0 Likes

THANK YOU SO MUCH with a little tweaks I got this to grab the property I wanted. I hate to ask but since I am a newbie I have to. Is there a way to grab the full part file path inside of the drawing if so how? I would also like to grab a sheet property specifically the sheet number property and how would I achieve that. Thanks again and I appreciate all the help you can give me.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report