AutoCAD Plant 3D General

Reply
Valued Contributor
Posts: 61
Registered: ‎03-13-2008
Message 11 of 14 (110 Views)

Re: Wrong size when creating pipes by API

05-16-2013 01:08 PM in reply to: dave.wolfe

Should I set Units at project configuration or at sample code? Could you post a piece of code?

 

Best regards

Valued Contributor
Posts: 61
Registered: ‎03-13-2008
Message 12 of 14 (106 Views)

Re: Wrong size when creating pipes by API

05-16-2013 01:55 PM in reply to: alexandrescoelho
I'm not sure if you mean this part.PartSizeProperties.NeedUnitScale(Units.Mm); but Units.Mm does not solve the problem
*Expert Elite*
dave.wolfe
Posts: 643
Registered: ‎12-04-2009
Message 13 of 14 (102 Views)

Re: Wrong size when creating pipes by API

05-16-2013 01:58 PM in reply to: alexandrescoelho

To be honest, I'm not sure what fixed it.  I changed that and it started drawing right again, but I don't know why. Incidentally, I'm using Metric specs in an imperial project drawing in a model that's in millimeters. 

 

No clue why it's working.  I do have the UNITS variable set to mm. But I don't know if that's it or not.

 

For a while it didn't work today, but now it does...

Dave Wolfe
Isaiah 57:15

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

A P3D Authorized Reseller
*Expert Elite*
dave.wolfe
Posts: 643
Registered: ‎12-04-2009
Message 14 of 14 (73 Views)

Re: Wrong size when creating pipes by API

06-26-2013 08:09 AM in reply to: dave.wolfe

FINALLY got this figured out.

 

You can retrieve the current drawing insertion settings via INSUNITS.

 

You'll have to create a method to determine which unit type you want to use, but the method you need to use is from the ContentManager.

 

When you use the GetSymbol() method from the ContentManager, one of the overrides includes passing in a scale from Autodesk.ProcessPower.PartsRepository.Units enum. When you specify the scale, the symbol gets created scaled to match.

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 interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

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