How do I access Part Geometry properties of a plant3d hanger support using vb.net?For example...I need the COP coordinates and "H" dimension for the support in the image.
Solved! Go to Solution.
Solved by NotFromFrance. Go to Solution.
Hi @NotFromFrance,
I know this is a old topic, but I need the same information.
Can you show me how to get this information?
I have been using the code below to get part properties.
public static Dictionary<string, Dictionary<string, object>> GetObjectProperties(ObjectId id, Database db)
{
var flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
var types = new List<Type>();
Dictionary<string, Dictionary<string, object>> result = new Dictionary<string, Dictionary<string, object>>();
using (Transaction trans = db.TransactionManager.StartTransaction())
{
var dbObj = trans.GetObject(id, OpenMode.ForRead);
types.Add(dbObj.GetType());
while (true)
{
var type = types[0].BaseType;
types.Insert(0, type);
if (type == typeof(RXObject))
break;
}
foreach (Type t in types)
{
if (result.ContainsKey(t.Name) == false)
{
result.Add(t.Name, new Dictionary<string, object>());
}
foreach (var prop in t.GetProperties(flags))
{
try
{
result[t.Name][prop.Name] = prop.GetValue(dbObj, null);
}
catch (System.Exception e)
{
Debug(e.Message, true);
}
}
}
}
return result;
}
Hi everyone,
I found the answer.
Firstly you need to add two dll files to your project PnP3dPipeUI.dll and PnP3dACPUtils.dll.
Below is a example in C#
// Imports required
using Autodesk.ProcessPower.PnP3dPipeSupport;
using Autodesk.ProcessPower.ACPUtils;
// ObjectID can be retrieved from a BlockTableRecord or selected entity on the drawing
ParameterList parameterList = SupportHelper.GetSupportParameters(objectId);
I hope this help someone else.
Can't find what you're looking for? Ask the community or share your knowledge.