Export Properties to XML using VBA

Export Properties to XML using VBA

michael_berger
Contributor Contributor
1,483 Views
4 Replies
Message 1 of 5

Export Properties to XML using VBA

michael_berger
Contributor
Contributor

Hi i'm looking for a way to export some iproperties (Custom an Standard) via VBA to an formatted xml.

 

the xml should look like this: 

 

    <PPSImport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Parts>
            <Part PartNo="Vault-Name">
                <PartNoExt></PartNoExt>
                <Description></Description>
                <CADFilename></CADFilename>
                <DrawingNo></DrawingNo>
                <Note></Note>
                <IsAutoRemoveable>0</IsAutoRemoveable>
                <FavoriteBendToolList></FavoriteBendToolList>
                <BendAllowanceType></BendAllowanceType>
                <KFactor></KFactor>
                <BasicMaterial></BasicMaterial>
                <Material></Material>
                <MaterialDescription></MaterialDescription>
                <MaterialThickness></MaterialThickness>
                <Length></Length>
                <Width></Width>
                <UnitOfDimension></UnitOfDimension>
                <CustomerNo></CustomerNo>
                <CustomerName></CustomerName>
            </Part>
        </Parts>
    </PPSImport>

 

can someone help me? i don't have many experience in vba so maybe someone can give me some code snipplets?

 

thanks.

0 Likes
1,484 Views
4 Replies
Replies (4)
Message 2 of 5

MechMachineMan
Advisor
Advisor

The google machine is fantastic.

 

https://social.msdn.microsoft.com/Forums/en-US/a1af3588-fe8f-492f-88e9-dd72fca624bf/write-xml-entry-...

 

 


--------------------------------------
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
Message 3 of 5

michael_berger
Contributor
Contributor
hi
thanks, it must be a very new invention this „google“...
well i found this
post too but i‘m very new in vba so i‘m not sure if it works direct from inventor to xml i dont want to export tonexcel and then to xml, i want direct from inventor to xml....
0 Likes
Message 4 of 5

dgorsman
Consultant
Consultant

Are you familiar with the MSXML DOM?

----------------------------------
If you are going to fly by the seat of your pants, expect friction burns.
"I don't know" is the beginning of knowledge, not the end.


0 Likes
Message 5 of 5

MechMachineMan
Advisor
Advisor

Half of programming is trying this out. The other half is researching.

 

As long as you properly import objects, add references, and wrap things in the proper Sub Main(), in the inventor rule environment, things run just like they do in VB.net.

 

If you were to have done any reading about the topic, you would know the rule environment is actually a vb.net environment. And you would also know that VBA and VB.net are VERY, VERY SIMILAR aside from some syntax and the occasional availability of objects.

 

This being said, if you take the code from the previous link, and paste it into the iLogic environment, and have the capability to read the plain English in the error trace, and google said error lines, you should be able to solve this problem without too much trouble. And you'll learn something, so that's great too!


--------------------------------------
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