Complexity of VBA / VB.NET poll

Complexity of VBA / VB.NET poll

Anonymous
Not applicable
716 Views
4 Replies
Message 1 of 5

Complexity of VBA / VB.NET poll

Anonymous
Not applicable

I'm just curious; I've started to realize what is possible when we have access to all the tools in the programming trade. I'd like to know what is the most "involved" piece of code you use, i.e. how much data manipulation you do within a single macro? 

 

For example, the most complex one I use (for now) digs into an assembly file, reads each file name in each subassembly, searches for the corresponding PDF file in another folder location, and copies the PDF files in a new folder on the desktop. It's not perfect, but it works sufficiently well to be useful. 

 

How about you? Thanx for playing along.

0 Likes
717 Views
4 Replies
Replies (4)
Message 2 of 5

Owner2229
Advisor
Advisor

Hi, I have quite similiar makro, but it does a bit more:

- Searches for drawing for each subassembly/part

- Opens and updates it if needed

- Saves new PDF if needed

- Takes all PDFs and places them in folder where our information system (IS) can read them

- Searches for DXF for each sheet metal part

- Unfolds the part and creates new/updated DXF

- Copies all DXFs to IS folder

- Gets some info from each assembly/part (part number, description, material, parent assembly, stock, quantity)

- Exports the all the gathered info in to an Excel table and asks if you want to open it.

 

 

My second makro simply copies currently opened assembly to current/new location and generates new part numbers for each of involved documents.

 

 

Third is custom content center. That's the biggest one of them. Over 2200 lines of code.

Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
0 Likes
Message 3 of 5

pball
Mentor
Mentor
I don't really have any complex scripts as most of mine simply print, export, or just do simple batch operations. I do have one function I'm quite proud of though. I wrote a function from scratch to recurse through every sub-assembly and part inside an assembly. I wrote that up when I noticed using AllReferencedDocuments included parent parts of derived parts. That function also uses an array function to add all of the drawings to a dynamically sized array which I use to print or export drawings.
Check out my style edits for the Autodesk forums
pball's Autodesk Forum Style
0 Likes
Message 4 of 5

Anonymous
Not applicable

Mine can be found at the link below

http://forums.autodesk.com/t5/inventor-customization/solid-bodies/m-p/5559115#M54908

 

It will export a step file for each solid body in the part file to the same directory that the part.ipt file was opened from.

open the step file

calculate the mass, area and volume

print the properties to a text file

save the text file to the part.ipt root directory

then close all step files and text file.

 

you will be left with a folder containing

root part.ipt file

.stp file for each solid body

.txt file with each solids properties.

0 Likes
Message 5 of 5

MechMachineMan
Advisor
Advisor

I have made various;

 

The latest of which will:

 

- Sort BOM's based upon our company specific standard

- Create a dwg pacakage, in order, with the largest area view placed on each sheet, as well as parts lists if they exist.

- Places an up to date revision table, and various sketched symbols on each sheet

- Fills in titleblock text

- Provides a toolbox for various other steps involved in our drawing package

- Prints PDF's with a programatic name to a specified folder, 1 sheet per pdf

- Creates dwg lists of all of the drawings in the assosciated pacakage


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes