New at 'Macros' & Programming

New at 'Macros' & Programming

cadman777
Advisor Advisor
1,921 Views
25 Replies
Message 1 of 26

New at 'Macros' & Programming

cadman777
Advisor
Advisor

Hi All,

 

I'm new at programming, and not so quick whitted any longer.

 

But I want to write little programs to do things in Inventor like I used to write in AutoLISP, Diesel and AutoCAD scripts. But after about 40 hours of Internet reading and watching videos, I'm even more lost.

 

Here's what I have been led to believe thus far:

1. iLogic is designed for manipulating 3d modeling, but not for system and I/O stuff

2. VB.Net is needed for system and I/O stuff

3. iLogic + VB.Net is for both.

I've looked at a few programs from people in here and other programs I found on the internet, but they make absolutely no sense to me b/c they're in VB.Net or VBA. The reason is b/c I do not understand the WORDS. I found Reference 'books' for iLogic on the Autodesk HELP web page, but can't find VB.Net References except the ga'zillions of pages on the Microsoft web site (similar to the Autodesk HELP pages). This is NO WAY to 'help' people learn this stuff. It's absurd to think that it is.

 

For me, this stuff is very difficult to absorb, b/c it's like learning a foreign language, and I'm not very good at languages. But I need to learn it to accomplish what I need to do. So, I need to find the REFERENCE BOOKS for VB.net that I can quickly and simply refer to when trying to understand code that other people have written. And I need a primer written from a COMMON SENSE approach for LINEAR THINKERS to learn the basics of VB.Net. I can't learn it by force of memory like I learned LISP when I was young.

 

Can anybody help me get this stuff learned so I can write my programs to end the repetitive tasks and streamline modeling and file processing?

Thanx ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
1,922 Views
25 Replies
Replies (25)
Message 2 of 26

bradeneuropeArthur
Mentor
Mentor

https://knowledge.autodesk.com/search-result/caas/simplecontent/content/my-first-inventor-plug-overv...

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 26

cadman777
Advisor
Advisor

Hi brandon,

Thanx for this link.

Been there already, and it's not my style of learning.

This is for people who can memorize huge amounts of information and BY FORCE OF MEMORY learn a subject.

That is NOT how linear thinkers learn, esp. when they get older.

I learn by PRINCIPLE.

Give me a principle, show me some relevant examples, and let me try it out.

Give it to me in useable modules, and I can learn anything.

Make the principle RELEVANT to my needs, and it will stick.

If not, it's a waste of my time and energy.

I learned a lot of stuff I know form outdated military training manuals.

That is how they do it in the military.

They operate on the KISS principle (or at least they did in the 40'-60's).

I'm at the age where my tolerance for waste and irrelevance has dropped to ZERO.

Thanx again ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 4 of 26

matt_jlt
Collaborator
Collaborator

Hi Chris, iLogic + vb.net is essentially the same thing. iLogic just has a bunch of simplified methods / shortcuts to get stuff done with less lines of code. You can definitely read and write files / in ilogic. Just have to import System.IO in the ilogic script.

 

Do you have an example of what you are trying to achieve? If you want something relevant to your needs, what are they so we can give you some help?  Even something as simple as you want to be able to export a drawing to PDF.

 

Personally I find it easier to learn looking at other peoples examples and just piece it together until I get it. I have never read or looked at a manual for any kind of program / language as i won't remember any of it.

 

You probably know this already but there are a bunch of working examples in the Inventor Help:

Inventor Help > Programming API Help >Sample Programs

 

0 Likes
Message 5 of 26

cadman777
Advisor
Advisor

Hi matt,

 

Thanx for the tips.

I'll look at the Help you mentioned.

It's encouraging to know I can do what I want w/o learning VB.

 

Here's some of the things I want to do after opening an assembly:

1. comb through all the parts (ipt) and select only one kind (like flat patterns, or w-beams, or formed sheetmetal, etc.)

2. save each part out to disk in a particular file format (such as STEP, DXF, STL, etc.) in a folder with a particular name (maybe by thickness or weight, etc.)

3. access iProps of each file and use them to create the folder and to write them into the filename (such as 'Mark#' and thickness, etc.)

4. OR, create a drawing view or views of each part to fill up a D-sized sheet of paper, and start filling consecutive sheets until all views of all parts are created

5. Each drawing view has a View Label with certain information in it based on a template and iProperties and other parameters of my choice (such as creating a flatpattern view of each sheetmetal part)

6. dimension each view according to rules, like is done in Tekla or Advance Steel or SDS/2 (for sheetmetal I want OAL, OAW, bend lines, and hole sizes)

7. There's other things I want to automate too. One of them is a structural steel library of parts, connections and miscellaneous. I tried that without using any programming and ran into a lot of problems. The biggest problem I ran into was copes/cuts/blocking/holes. How do make it easy to populate an assembly file based on an ipt full of sketches with ContentCenter beams that cope and connect to each other according to engineering specs. Then create weldment drawings and single part drgs for the fabricators, or else export all parts out to disk as STL with MARK#'s on them so the CNC machine can process them.

 

Thanx for your input!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 6 of 26

cadman777
Advisor
Advisor

Hi matt,

 

OK, I spent a couple hours rummaging through the Autodesk Help and Internet and just can't figure out where to get started. The macros that look like I could use them have VB in them, and I want to do everything with iLogic.

 

If I can get good at iLogic, I'll move on to VB.

But I can't learn both at the same time ... TMI!

 

So, where do I begin?
Where is the book that tells me what things mean?

Breaking into this subject is the key.

But I haven't figured out how to break-into it.

 

For example:
What do you mean by "import System.IO in the ilogic script"?

My head is stuck on AutoCAD scripts and AutoLISP (most of which I forgot).

 

Another example:

How do I say in iLogic: "Use the iam file that is already opened and find only sheetmetal parts, and save them to a local folder according to their thickness, in DXF format, with the filename = StockNumber (iProp) "-" G_T (Param) "Thk"? Where do I begin? Where are the reference manuals that catalog all the words by category and function, and explain the syntax, so I can figure out how to use these words to make the computer program do these things?

 

Cheers ... 

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 7 of 26

cadman777
Advisor
Advisor

OK, here's my example of what I'm trying to understand if anybody wants to chime-in on it. I annotated it the way I understand what's going on, but I may be WRONG and also there's things I don't understand:

 

'Export all flatpatterns out to disk as DXF into the local folder specified below

'START WITH ASSEMBLY FILE
'Define 'oDoc' variable as assembly component
Dim oDoc As AssemblyDocument
'Assign to 'oDoc' variable the open iam file
oDoc = ThisApplication.ActiveDocument

'VERIFY THAT AN ASSEMBLY FILE IS OPEN
'Check that the active document is an assembly file, and if not, then notify the user to open an assembly file
If oDoc.DocumentType <> kAssemblyDocumentObject Then
	MessageBox.Show("Please run this rule from the assembly file.", "iLogic")
	Exit Sub
End If

'USER INPUT
'Verify user wants to run macro or terminate it
RUsure = MessageBox.Show ( _
"This will create a DXF file for all of the asembly components that are sheet metal." _
& vbLf & "This rule expects that the part file is saved." _
& vbLf & " " _
& vbLf & "Are you sure you want to create DXF for all of the assembly components?" _
& vbLf & "This could take a while.", "iLogic  - Batch Output DXFs ", MessageBoxButtons.YesNo)
If RUsure <> vbYes Then Exit Sub

'GET THE NAME OF THE OPENED ASSEMBLY FILE AND ITS DIRECTORY SO IT CAN BE USED IN THE SUB-DIRECTORY NAME AND DXF FILE NAMES
'Define 'oAsmName' variable as text string & assign to 'oAsmName' variable the open iam filename minus the last 4 characters on the r.h. end
Dim oAsmName As String = Left(oDoc.DisplayName, Len(oDoc.DisplayName) - 4)
'Define 'oPath' variable as text string & assign to 'oPath' variable the open iam file's full path name
Dim oPath As String = ThisDoc.Path

'Define 'oFolder' variable as text string & assign to 'oFolder' variable the path name below ("oPath\oAsmName DXF Files")
Dim oFolder As String = oPath & "\" & oAsmName & " DXF Files"

'Check for the existence of the DXF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
    System.IO.Directory.CreateDirectory(oFolder)
End If

'- - - - - - - - - - - - - BEGIN WORKING AT THE PART LEVEL - - - - - - - - - - - -

'USE THE ASSEMBLY'S BOM TO TO GET THE PART INFORMATION
'Define 'oBOM' variable as BOM component
Dim oBOM As BOM
'Assign to 'oBOM' variable the opened iam BOM ???????????????
oBOM = oDoc.ComponentDefinition.BOM
'What does the "." mean in the above word (oDoc.ComponentDefinition.BOM) ????????????????????
'Look at BOM as a Structured BOM ???????????????????????????
oBOM.StructuredViewEnabled = True

'START FILTERING OUT THE PARTS LISTED IN THE BOM TO ONLY SHEETMETAL PARTS
'Define 'oBOMView' variable as BOMView component ?????????????????? and assign to 'oBOMView' variable the BOM Item# ????????????????
Dim oBOMView As BOMView = oBOM.BOMViews.Item(oBOM.BOMViews.Count)
'Begin process of recursing BOM records (rows) from beginning to end
For Each oRow As BOMRow In oBOMView.BOMRows
Try
	'Define 'oCD' variable as ipt and assign to 'oCD' variable the model tree name shown in the BOM Item#
	Dim oCD As ComponentDefinition = oRow.ComponentDefinitions.Item(1)
	'Define 'iDoc' variable as Iventor document and assign to 'iDoc' variable the BOM Item#
	Dim iDoc As Document = oCD.Document
	'Filter out all but sheetmetal parts in the recursive BOM procedure above
	If iDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Continue For
	'Where did you get that sheetmetal file i.d. number ??????????????????
	'Define 'iName' variable to a text string and assign to 'iName' variable the part's BOM Item# full filename
	Dim iName As String = iDoc.FullFileName
	
	'Check that model is saved and has a filename ???????????????????
	If iName = vbNullString Then Continue For
	'Assign to 'iDoc' variable the open ipt file
	iDoc = ThisApplication.Documents.Open(iName)
	'Assign to 'oCD' variable the open ipt file's "ComponentDefnintion" ?????????
	oCD = iDoc.ComponentDefinition
	
	'Define 'oMARK' variable as a text string and assign to 'oMARK' variable the open ipt file's BOM Item#
	Dim oMARK As String = oRow.ItemNumber
	'MessageBox.Show("oMark: " & oMARK)
	
	'Test that file to see if it has a flatpattern already created
	Try
		'If that file does NOT have a flatpattern already created, then create one
		If Not oCD.HasFlatPattern Then
			oCD.Unfold()
		Else
			'But if the open file already has a flatpattern, then start editing it
			oCD.FlatPattern.Edit()
		End If
		'Define 'sOut' variable as a text string and assign to 'sOut' variable the below name/string ("FLAT PATTERN DXF + ??????????????") What's "?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE" mean ??????????????
		Dim sOut As String = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE" 'What is the PURPOSE of this name/string ???????????????
		'Create DXF file from the open part's flatpattern file to the below named filename ("oFolder\oAsmName - MARK oMARK.dxf") I also want to add the thickness followed by " THK".
		oCD.DataIO.WriteDataToFile(sOut, oFolder & "\" & oAsmName & " - MARK " & oMARK & ".dxf")
		'Exit editing of flatpattern
		oCD.FlatPattern.ExitEdit()
	'What is this? What does it do ???????????????????????????
	Catch ex As Exception
		MsgBox(ex.Message)
	'End Test of all files and creation of flatpattern DXF files
	End Try
	'Close the open file
	iDoc.Close(True)
Catch
End Try
'Open the next ipt sheetmetal file in the BOM and process it like before
Next

I believe I got that code from 'Owner' in another link. Thanx buddy!

 

I tried a number of things to get the Stock Number iProperty to replace the Item Number BOM iProperty, but it always used only the assembly Stock Number, not the individual files Stock Number. So that's one thing I need: How do I get the Stock Number from the individual files into their DXF filename?

 

Very frustrated! I spent 2 whole days trying things, and looking on the Internet for answers, but no success. This programming is a MEGA PITA due to the total and complete lack of structured information for NOOBIES like me. I have 2 feet of books on my shelf behind me that I used to use for AutoLISTP and DIESEL. So whenever I needed to look up a command I forgot, or a function I couldn't remember, or the syntax of something, or DXF codes OR WHATEVER, I had those references at my fingertips. And I rarely had any problems ferreting out code.

 

But with this iLogic scheme, I don't have even one book to help me like that. Moreover, and all the so-called references on the Autodesk Help site are very difficult to find information in. It's like trying to get answers out of the damned IRS, for God's sake!

 

Anyways, if someone can find it in their heart of hearts to either tell me how to do this b.s. AND show me where the REAL reference books are for all this code nonsense, or just steer me to those reference books, I'd appreciate it.

 

Thanx ...

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 8 of 26

matt_jlt
Collaborator
Collaborator

I have never seen or read any reference books so I can't help you there. If i can't work out what im trying to do i usually look at the forums / google it and go from there. Somethimes you just get stuck and ask on the forums too.

One thing you might find helpful is the Object Model Chart. It essentially shows you where objects are located in the structure of inventor.
The following link shows you where it is located on your computer (You need to install the SDK which is already on your machine)
https://www.autodesk.com/developer-network/platform-technologies/inventor/overview

Don't worry about the system.io comments for now. I don't even think you need to declare it for some things.

My brain can't even begin to understand LISP so your ahead of me there. I've had to try reverse a few functions written in that and i had no chance without significant help.

For me it helps to understand how inventor works when you are coding because that's exactly how the API is structured. Not like autocad where its all in a big group of stuff thats hard to deal with.

Once you get the basic functions down you can get most things done. From your comments it looks as though you have a decent understanding on loops and if statements etc.

One site with some examples - but again google / stack overflow are great sources for general vb.net help like how to creat earrays, strings, loops etc.
https://www.dotnetperls.com/for-vbnet

 

Edit: I'll try explain your comments / quesitons from above

0 Likes
Message 9 of 26

matt_jlt
Collaborator
Collaborator

I just realised, are you running inventor 2010? If you are, you will probably find it easier to write / test your code in VBA-Macro first as it has the autocomplete feature that shows you the object model as you are typing.

 

I know it's not iLogic/VB.net but it's almost exactly the same language and structure. I used to always write my code in that before inventor 2019 where they added the autocomplete to inventor ilogic editor.

 

For example: if you type in "ThisApplication." in the VBA editor. As soon as you type the "." it will give you a list of all members available in the "ThisApplication" object.

FYI, the dot "." is just a step into the object much like the "/" in your windows folders or website address bar.

 

0 Likes
Message 10 of 26

matt_jlt
Collaborator
Collaborator

Here is the code commented for you.

'Export all flatpatterns out to disk as DXF into the local folder specified below

' Notes:
' ThisApplication = Inventor
' ThisApplication.ActiveDocument = Currently open document
' You need to define what an object is before you set it to something. And everything pretty much has to come from inventor application.
' e.g. Dim oDoc As AssemblyDocument = ThisApplication.ActiveDocument
' You can't just access the active document without accessing it through the inventor application.
' It all works Like a big tree heirachy If that makes sense? But once you have the document you can access everything in that object from that point.


'Define oDoc as an assembly document + Assign it to the active/open document in Inventor
Dim oDoc As AssemblyDocument 'Define 'oDoc' variable as assembly component
oDoc = ThisApplication.ActiveDocument 'Assign to 'oDoc' variable the open iam file


'Check that the active document is an assembly file, and if not, then notify the user to open an assembly file
If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then ' A list of document types can be found if you search in the inventor API help for "kAssemblyDocumentObject" 
	MessageBox.Show("Please run this rule from the assembly file.", "iLogic")
	Exit Sub
End If

'USER INPUT
' This could have been done better as the RUsure variable isn't declared correctly. 
' Although it will still work, it might make it a bit confusing If you don't know what the object type is.
'Verify user wants to run macro or terminate it
RUsure = MessageBox.Show ( _
	"This will create a DXF file for all of the asembly components that are sheet metal." _
	& vbLf & "This rule expects that the part file is saved." _
	& vbLf & " " _
	& vbLf & "Are you sure you want to create DXF for all of the assembly components?" _
	& vbLf & "This could take a while.", "iLogic  - Batch Output DXFs ", MessageBoxButtons.YesNo)
' Compare the result from the messagebox to determine if it should exit the sub
If RUsure <> vbYes Then Exit Sub

'GET THE NAME OF THE OPENED ASSEMBLY FILE AND ITS DIRECTORY SO IT CAN BE USED IN THE SUB-DIRECTORY NAME AND DXF FILE NAMES
'Define 'oAsmName' variable as text string & assign to 'oAsmName' variable the open iam filename minus the last 4 characters on the r.h. end
Dim oAsmName As String = Left(oDoc.DisplayName, Len(oDoc.DisplayName) - 4)
'Define 'oPath' variable as text string & assign to 'oPath' variable the open iam file's full path name
Dim oPath As String = ThisDoc.Path

'Define 'oFolder' variable as text string & assign to 'oFolder' variable the path name below ("oPath\oAsmName DXF Files")
Dim oFolder As String = oPath & "\" & oAsmName & " DXF Files"

'Check for the existence of the DXF folder and create it if it does not exist
' This is the system.io items i was talking about previously, ilogic / vb.net can do this easily where VBA doesn't have as simple functions. Just skip this step if you are looking at VBA.
If Not System.IO.Directory.Exists(oFolder) Then
    System.IO.Directory.CreateDirectory(oFolder)
End If

'- - - - - - - - - - - - - BEGIN WORKING AT THE PART LEVEL - - - - - - - - - - - -

'USE THE ASSEMBLY'S BOM TO TO GET THE PART INFORMATION
'Define 'oBOM' variable as BOM component
Dim oBOM As BOM
'Assign to 'oBOM' variable the opened iam BOM ???????????????
' The BOM is the bill of materials object / parts list for the assembly.
' This code Is Using the BOM To iterate through all the parts In the assembly.
oBOM = oDoc.ComponentDefinition.BOM
' What does the "." mean in the above word (oDoc.ComponentDefinition.BOM) ????????????????????
' The dot "." is just a step down into the object, the same as a "\" in your filename directory or web address.
' so it would read like oDoc\ComponentDefinition\BOM. it's just the way VBA / VB.net/ilogic read it.

'Look at BOM as a Structured BOM ???????????????????????????
' This is just setting the active assembly Bill of Materials to structured view.
' You can Do this manually by looking at the BOM In the assembly and you will notice three tabs Model Data, Structured, Parts Only
' The code is just activating the structured tab
oBOM.StructuredViewEnabled = True

'START FILTERING OUT THE PARTS LISTED IN THE BOM TO ONLY SHEETMETAL PARTS
'Define 'oBOMView' variable as BOMView component ?????????????????? and assign to 'oBOMView' variable the BOM Item# ????????????????
' This is just getting the current view of the assembly BOM (after the structured view has been activated) and getting all of the items / rows
Dim oBOMView As BOMView = oBOM.BOMViews.Item(oBOM.BOMViews.Count)
'Begin process of recursing BOM records (rows) from beginning to end
For Each oRow As BOMRow In oBOMView.BOMRows
Try
	'Define 'oCD' variable as ipt and assign to 'oCD' variable the model tree name shown in the BOM Item#
	Dim oCD As ComponentDefinition = oRow.ComponentDefinitions.Item(1)
	'Define 'iDoc' variable as Iventor document and assign to 'iDoc' variable the BOM Item#
	Dim iDoc As Document = oCD.Document
	'Filter out all but sheetmetal parts in the recursive BOM procedure above
	If iDoc.SubType <> "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then Continue For
	'Where did you get that sheetmetal file i.d. number ??????????????????
	' This can be found by searching {9C464203-9BAE-11D3-8BAD-0060B0CE6BB4} in the help API.
	' It's just one of those things that aren't as easy to find but you will find lots of examples using this in the forums
	'Define 'iName' variable to a text string and assign to 'iName' variable the part's BOM Item# full filename
	Dim iName As String = iDoc.FullFileName
	
	'Check that model is saved and has a filename ???????????????????
	' This is only checking that the iName string isn't empty. Could have also been written as If iName = "" Then Continue For
	If iName = vbNullString Then Continue For
	'Assign to 'iDoc' variable the open ipt file. This opens and assigns the document at the same time.
	iDoc = ThisApplication.Documents.Open(iName)
	'Assign to 'oCD' variable the open ipt file's "ComponentDefnintion" ?????????
	' The component definition is where all the info is kept inside the document object. 
	' Refer To the API Object tree chart And you will Get a better understanding On Where objects / properties are located inside Of things.
	oCD = iDoc.ComponentDefinition
	
	'Define 'oMARK' variable as a text string and assign to 'oMARK' variable the open ipt file's BOM Item#
	Dim oMARK As String = oRow.ItemNumber
	'MessageBox.Show("oMark: " & oMARK)
	
	'Test that file to see if it has a flatpattern already created
	Try
		'If that file does NOT have a flatpattern already created, then create one
		If Not oCD.HasFlatPattern Then
			oCD.Unfold()
		Else
			'But if the open file already has a flatpattern, then start editing it
			oCD.FlatPattern.Edit()
		End If
		' All of the strings below is just how inventor sends the settings to the exporter. 
		' If you search the forums Or maybe the API Help you will probably find examples Of all the different settings With an explanation.
		'Define 'sOut' variable as a text string and assign to 'sOut' variable the below name/string ("FLAT PATTERN DXF + ??????????????") What's "?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE" mean ??????????????
		Dim sOut As String = "FLAT PATTERN DXF?AcadVersion=2004&OuterProfileLayer=IV_OUTER_PROFILE" 'What is the PURPOSE of this name/string ??????????????? <see comments above, its the export settings>
		'Create DXF file from the open part's flatpattern file to the below named filename ("oFolder\oAsmName - MARK oMARK.dxf") I also want to add the thickness followed by " THK".
		oCD.DataIO.WriteDataToFile(sOut, oFolder & "\" & oAsmName & " - MARK " & oMARK & ".dxf")
		'Exit editing of flatpattern
		oCD.FlatPattern.ExitEdit()
	'What is this? What does it do ???????????????????????????
	' This is apart of vb.net Try-Catch-End Try error handling.
	' If you search online For vb.net Try Catch you will Get a good idea On how it Is used.
	' Catch catches any errors and assigns the error message to variable 'ex'
	Catch ex As Exception
		' This just displays a messagebox with the error.message
		MsgBox(ex.Message)
	'End Test of all files and creation of flatpattern DXF files
	End Try
	'Close the open file
	iDoc.Close(True)
Catch
End Try
'Open the next ipt sheetmetal file in the BOM and process it like before
Next

 Hopefully this helps you at least make a start.  

0 Likes
Message 11 of 26

cadman777
Advisor
Advisor

Matt,

 

Thanx for this detailed analysis!

I will digest it and get back to you with questions.

 

This reminds me of when I was in my early 20's and going to college. I met a guy in his late 40's who just retired out of the military but couldn't collect his pension till he hit his late 60's. He was going to the same school as me and had the same classes. But he was 'set in his ways' and had a hard time learning stuff. But since I was so smart back then, AND NICE ABOUT IT (like you), he tapped me to help him study. So he invited me over to his house and we studied while his wife made us food and then we played w/his kids. I got to stay over on weekends instead of living in the dorms (the school food sucked!). This went on for about one semester, and he graduated with B's. He said he would have failed w/o my help. I believe that old man is ME, who's now trying to 'step up' in a greedy society controlled by evil commerce.

 

Your kindness is appreciated!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 12 of 26

cadman777
Advisor
Advisor

Matt,

Thanx for the links, I'll check them out.

Yes, I already know about the model tree, but don't know how to write code to access it.

I guess a paradigm shift is needed by me at this point, from LISP to VB.

I remember how much I HATED VB when I tried learning it a decade ago!

Cheers ...

 

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 13 of 26

cadman777
Advisor
Advisor

I can't find iProperties in the Object Model.

What's that about?

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 14 of 26

cadman777
Advisor
Advisor

The attached video is the only thing I found that gives me a good intro to this subject.

This is one of the things I was looking for, b/c it explains the unknowns at the beginning without all the procedural stuff.

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 15 of 26

matt_jlt
Collaborator
Collaborator

I don't have a copy of the inventor 2010 API object model but the iproperties are called propertysets for API purposes.

 

' Get Part Number
messagebox.show(oDoc.PropertySets.Item("Design Tracking Properties").Item("Part Number").Value

Object model screenshot from the API help on iPropertiesproperty object model.jpg

 

The below list are the available property sets you can access, each having different properties in it.
* Summary Information
* Document Summary Information
* Design Tracking Properties
* User Defined Properties

The last one is where the custom iproperties are located.

 

0 Likes
Message 16 of 26

bradeneuropeArthur
Mentor
Mentor

See the link for the object model:

 

https://knowledge.autodesk.com/search-result/caas/simplecontent/content/autodesk-C2-AE-inventor-C2-A...

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 17 of 26

matt_jlt
Collaborator
Collaborator

Thanks for the links, only he is running Inventor 2010 but it should be pretty similar for the most part though.

Message 18 of 26

bradeneuropeArthur
Mentor
Mentor

There shouldn't be that much differences in it!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 19 of 26

cadman777
Advisor
Advisor

Matt/Brandon,

I tried some macros from this forum.

They were for new Inventor.

They ran perfect in 2010 version.

This is OK by me!

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes
Message 20 of 26

cadman777
Advisor
Advisor

First 10 minutes of the video is good.

I have resigned myself to learning VBA.

BIG MISTAKE, but necessary.

My brain will become MUSH soon enough!

 

The rest of the video has WAY too many words and 'tricks'.

It's like navigating through a MINEFIELD.

They tell you DO NOT STEP OFF THE MAP!

If you step outside the map, you EXPLODE!

 

Same with this video:
Too many things in the GUI, but only one tight map path to travel.

It winds around and through and inside and out, but nobody explains anything so it has NO meaning.

This is what I mean by PROGRAMMER CHAOS.

You memorize piles of things, and if you can remember them, you can use them.

There is no structure to programmers.

In their head it must be a wild jungle! LOL

... Chris
Win 7 Pro 64 bit + IV 2010 Suite
ASUS X79 Deluxe
Intel i7 3820 4.4 O/C
64 Gig ADATA RAM
Nvidia Quadro M5000 8 Gig
3d Connexion Space Navigator
0 Likes