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
Project units?
Well, I tried to change while creating pipes but no success. After I tried to change at project settings, no success either.
Any sugestion?
I meant create a new project with Metric units, or if you have already, try it in a project with Imperial units.
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.
Same problem, I tried to set other diameters from available diameter range but neither diameter was created with rigth visual size. Any other suggestion?
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,
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
Did you try setting Units.Metric? The units is the target units you want. I did that and I think it fixed my problem.
Should I set Units at project configuration or at sample code? Could you post a piece of code?
Best regards
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...
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.
Can't find what you're looking for? Ask the community or share your knowledge.