AutoCAD Plant 3D General

Reply
Valued Contributor
alexandrescoelho
Posts: 61
Registered: ‎03-13-2008
Message 1 of 14 (235 Views)

Wrong size when creating pipes by API

235 Views, 13 Replies
05-14-2013 09:55 AM

Hello everybody,

I've been testing the sample which came with Plant3D SDK (Plant SDK 2013\Samples\Piping\CreatePipeline) for modeling from a .NET assembly. When execute with NETLOAD and then CREATEPIPE I can see all components created on current drawing. The problem is about size for those components. If you check the image, components created from dll is smaller than they should be. Beside a pipe with 10" (red) created from DLL there is a pipe with 10" too (red), but it was created through the plant3d interface. So the question is, why size is different when creating components by .NET dll ? What I have to do to get the right size? Anyone else had same problem? 

Thanks

Employee
TomislavGolubovic
Posts: 534
Registered: ‎12-01-2010
Message 2 of 14 (221 Views)

Re: Wrong size when creating pipes by API

05-14-2013 02:11 PM in reply to: alexandrescoelho

Project units?



Tomislav Golubovic
Plant Solutions Engineer
Autodesk Australia / New Zealand
Autodesk, Inc.

Valued Contributor
alexandrescoelho
Posts: 61
Registered: ‎03-13-2008
Message 3 of 14 (213 Views)

Re: Wrong size when creating pipes by API

05-14-2013 04:44 PM in reply to: TomislavGolubovic

Well, I tried to change while creating pipes but no success. After I tried to change at project settings, no success either. 

Any sugestion?

Employee
TomislavGolubovic
Posts: 534
Registered: ‎12-01-2010
Message 4 of 14 (210 Views)

Re: Wrong size when creating pipes by API

05-14-2013 05:14 PM in reply to: alexandrescoelho

I meant create a new project with Metric units, or if you have already, try it in a project with Imperial units.



Tomislav Golubovic
Plant Solutions Engineer
Autodesk Australia / New Zealand
Autodesk, Inc.

Valued Contributor
alexandrescoelho
Posts: 61
Registered: ‎03-13-2008
Message 5 of 14 (207 Views)

Re: Wrong size when creating pipes by API

05-14-2013 05:26 PM in reply to: TomislavGolubovic

Tried it already. First only metric, second imperial and finally mixed metric and imperial. In all cases, if pipe were created programmatically size is lower them it should be, by the other hand if create through route pipe with same size pipe was created is right. I'm not sure if can I post my test project attached to this thread.    

*Expert Elite*
dave.wolfe
Posts: 654
Registered: ‎12-04-2009
Message 6 of 14 (201 Views)

Re: Wrong size when creating pipes by API

05-14-2013 07:01 PM in reply to: alexandrescoelho
Add the second line when you create the new object.

part = new Pipe();
part.OuterDiameter = (double)sPart.PropValue("MatchingPipeOD");
Dave Wolfe
Isaiah 57:15

ECAD, Inc.
Tips and Tricks on our blog: Process Design, from the Outside

A P3D Authorized Reseller
Valued Contributor
alexandrescoelho
Posts: 61
Registered: ‎03-13-2008
Message 7 of 14 (188 Views)

Re: Wrong size when creating pipes by API

05-15-2013 10:01 AM in reply to: dave.wolfe

Same problem, I tried to set other diameters from available diameter range but neither diameter was created with rigth visual size. Any other suggestion?

*Expert Elite*
dave.wolfe
Posts: 654
Registered: ‎12-04-2009
Message 8 of 14 (183 Views)

Re: Wrong size when creating pipes by API

05-15-2013 11:12 AM in reply to: alexandrescoelho

No, this is what fixed the issue for me.  Just make sure the spec part you looked up has the matchingpipeod that you expect, before setting the outer diameter.

Dave Wolfe
Isaiah 57:15

ECAD, Inc.
Tips and Tricks on our blog: Process Design, from the Outside

A P3D Authorized Reseller
Valued Contributor
alexandrescoelho
Posts: 61
Registered: ‎03-13-2008
Message 9 of 14 (170 Views)

Re: Wrong size when creating pipes by API

05-16-2013 12:23 PM in reply to: alexandrescoelho

Dave,

 

Checking carefully, I found out that this problem occurs only when plant3d unit project is millimiter or mixed. For imperial it works fine. It's seems a issue to set which unit is being used for creating pipe. Is there any way to set which unit should be used while creating components? 

I've already tried this part.PartSizeProperties.NeedUnitScale(Units.Inch) but no sucess.

 

Thank you

 

Best regards

*Expert Elite*
dave.wolfe
Posts: 654
Registered: ‎12-04-2009
Message 10 of 14 (163 Views)

Re: Wrong size when creating pipes by API

05-16-2013 12:34 PM in reply to: alexandrescoelho

Did you try setting Units.Metric?  The units is the target units you want.  I did that and I think it fixed my problem.

Dave Wolfe
Isaiah 57:15

ECAD, Inc.
Tips and Tricks on our blog: Process Design, from the Outside

A P3D Authorized Reseller

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Plant 3D Category!

The AutoCAD Plant 3D forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Ask the Community