Hi,
Is it possible to create a new part reference and attach it to a block in AutoCAD Mechanical 2022 using VB.net? What I am trying to do is grab a selected block reference, create a part reference and attach that to the selected block reference and then fill in custom part reference property fields.
So for instance, I would select a block (or multiple blocks) and then write a command that would take the block name (my companies part number) and then automate pulling information and populating the part reference property fields with a description, manufacturer and manufacturer part number based on the block name. I have added those custom properties [MFG, MFG_PN, Description] into the BOM/parts list within AutoCAD Mechanical, but I'm not sure how to access them since they won't be native properties of the part reference class.
I have looked into the Developer's Guide for AutoCAD Mechanical and see some of the VBA stuff, but I don't know exactly how to translate that information into VB.Net since ThisDrawing and .AddCustomObject are not supported in VB.Net.
ex from Acad Mech Dev Guide.
Set oSymBB = ThisDrawing.Application.GetInterfaceObject("SymBBAuto.McadSymbolBBMgr")
Set oPartRef = ThisDrawing.ModelSpace.AddCustomObject("AcmPartRef").
If anyone has worked with part references in VB.Net before I would greatly appreciate any guidance that they might impart. As I stated above, I'm specifically looking at creating a new part reference, attaching it to an existing block reference and accessing customized Thanks, Ian.