.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

P3D Support Properties

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
NotFromFrance
514 Views, 3 Replies

P3D Support Properties

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.P3D support type.PNG

 

Tags (2)
3 REPLIES 3
Message 2 of 4

Found the Provided Example in the Plant SDK
Message 3 of 4

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

 

 

Message 4 of 4

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.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report