AutoCAD Plant 3D Forum
Welcome to Autodesk’s AutoCAD Plant 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Plant 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CreatePipeline sample invokes exception

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
frodoh
550 Views, 4 Replies

CreatePipeline sample invokes exception

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()

4 REPLIES 4
Message 2 of 5
fenton.webb
in reply to: frodoh

It works fine for me... You are obviously loading the sample into Plant3d, and not normal AutoCAD right?




Fenton Webb
AutoCAD Engineering
Autodesk

Message 3 of 5
frodoh
in reply to: frodoh

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

 

 

Message 4 of 5
frodoh
in reply to: fenton.webb

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.

Message 5 of 5
fenton.webb
in reply to: frodoh

You are not alone - the internet has found that out about me a million times! 🙂




Fenton Webb
AutoCAD Engineering
Autodesk

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost