Message 1 of 2
Inventor Factory API C# to VB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I want to make my first steps with the Inventor API, especially the Factory API. I found this help page:
There is a code snippet for placing an specific asset in an factory layout. My problem is I couldn't translate it from C# (I hope this is right?) to Visual Basic.
using APIv2 = Autodesk.Factory.PublicAPI.Objects.v2;
…
var api = Autodesk.Factory.PublicAPI.API.Instance;
APIv2.AssetInstance newInst1 = new APIv2.AssetInstance()
{
AssetID = "41c84844-7b28-4903-bebd-365ca3a6a53c", //Straight Belt Conveyor
Position = new System.Windows.Media.Media3D.Matrix3D() { OffsetX = 0, OffsetY = 0, OffsetZ = 0 },
};
var insts = api.AddAssetInstances(layout, new PublicAPI.Currency.v2.IAssetInstance[] { newInst1 });
System.Windows.MessageBox.Show(insts.Length.ToString(), "Added instances");
Is there anybody who can help? Or is there any example for a vb code doing anything similar?
Kind regards,
mk