The CreatePipeline sample from the Plant3D SDK trips with exception after calling CREATEPIPE() command. I am using VS 2010 and I tried building using "Any CPU" and "x64". Exception trace listed below.
Autodesk.ProcessPower.PnP3dObjects.UnableToLinkException: Exception of type 'Autodesk.ProcessPower.PnP3dObjects.UnableToLinkException' was thrown.
at Autodesk.ProcessPower.PnP3dObjects.PipingObjectAdder.Add(PartSizeProperties part, Pipe pipe)
at CreatePipeline.PipeSegment.AppendPart(Transaction trans, PipingObjectAdder POA) in D:\Projects\Plant3D-Samples\CreatePipeline\PipeSegment.cs:line 84
at CreatePipeline.Program.AddObjectsToDatabase(List`1 pipelineparts) in D:\Projects\Plant3D-Samples\CreatePipeline\Program.cs:line 198
at CreatePipeline.Program.CreatePipeline() in D:\Projects\Plant3D-Samples\CreatePipeline\Program.cs:line 158
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
Solved! Go to Solution.
Solved by fenton.webb. Go to Solution.
It works fine for me... You are obviously loading the sample into Plant3d, and not normal AutoCAD right?
Thank you for your consideration. I can't help but think I am doing something boneheaded that we on the internet will all laugh about later.
To your question: Yes - I launched Plant3D, created a new project, called NETLOAD and invoked CREATEPIPELINE(). I feel like I incorrectly configured the development environment. I also tried Plant3D 2014 using the sample in the 2014 SDK. An interesting behavior is that the fault occurs at the section listed below...
if (part.GetType() == typeof(Pipe))
{
Pipe pipe = part as Pipe;
pipeObjAdder.Add(specPart, pipe);
}
The specPart parameter is of type SpecPart but the documentation for the PipingObjectAdder::Add() method (and the exception stack trace) lists the type as PartSizeProperties. I could not discern an inheritance relationship among the types. I am pretty confident this is a red herring because the linker would not allow the wrong type to be passed in, but I found the type discrepancy puzzling.
Thank you,
Fred
Dumb mistake on my part - I did two things that resolved the problem but I think the second was the one that worked (thanks to Fenton's guidance).
1) Copied the DLL to ./PLNT3D folder.
2) Created Plant3D project and a drawing in the "Plant 3D Drawings" tree group for the "Project" view. I then ran NETLOAD and CREATEPIPELINE.
The good news is that Fenton Webb responded to my question. The bad news is that the internet knows I am dumb.
You are not alone - the internet has found that out about me a million times! 🙂