Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Pro/TOOLKIT - Size of Sheetmetal Flat

GordonW

New member
We are trying to determine the overall flat size of a sheetmetal part (max X, max Y) in Pro/TOOLKIT. ProSolidOutlineGet only provides the correct information if the orientation of the flat view coincides with the orientation of the model CSYS.Any suggestions for determining this information in Pro/TOOLKIT in the part or the drawing (scale 1 view) would be appreciated.
 
Yeah, that CSYS thing is a bummer. I have long wanted to write a program for this. You have to guarantee the the flat pattern for every part in in the default CSYS. I know I can't say that for every one of our parts. I have considered ProSurfaceExtremesEval funtion, because this one lets you determine the vector. If grain (for stainless applications) is a consideration, this complicates the issue even further. In a nutshell, I think for this program to work, you would need to be sure all parts were correctly oriented, or contained a CSYS oriented the proper way on the flat to depect x, y, and or grain direction.
 
Gordon,


This is not a problem at all. Here is the procedure:

  1. <LI>In the 3D part, retrieve the view that represents the overall flat size. Use ProViewNameToView.</LI>
    <LI>Get the matrix of that 3D view. Use ProViewMatrixGet.</LI>
    <LI>Normalize that matrix. Look forthe function UserMatrixNormalize for an example (it's not a standard part of the API).</LI>
    <LI>Compute the outline of the solid passing the matrix of the 3D view. Use ProSolidOutlineCompute.</LI>
    <LI>Compute the max X and max Y. The solid outline is the upper right and lower left corners of the outline. To get the max dimensions use the following code:</LI>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">


dSolidXDim = fabs(pro_p3dSolidOutline[1][0] - pro_p3dSolidOutline[0][0]);


dSolidYDim = fabs(pro_p3dSolidOutline[1][1] - pro_p3dSolidOutline[0][1]);</BLOCKQUOTE>


This will give you the max X and max Y.
 
2008-05-05_234942_Solid_Outline_Test.zip


2008-05-05_235241_sample_parts.zipHello Williams,


With respective above i too agree.I followed the same some time back in one if my application.But i have one problme to compute this.Some of the parts ProSolidOutlineCompute() not able to give the exact values.It is giving worng double value.For example especially for round parts let take the eg:Gide_Pillart_1 is the 3D part i took.


X=43.000000Y=150.000036Z=42.851944; X and Z value are same for round parts.Z value is not exactly gives what it suppose to give as 43.00000;


I am attaching the code for it and the 3D part on which i run the application to get the values.


Plz let me know where the problem exist.Severve is down i could not able to upload the files.I will upload when sever is up.


With regards,


Kishore v
Edited by: kishorev
 
We have been working on the suggestion posted by Patrick Williams with pretty good success. (Get the view matrix, normalize the matrix, and calculate the maximum outline, see posting for details)<?:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" />


However, we seem to be getting precision discrepancies related to normalizing the view matrix. For example, a 2.000 x 4.000part returns a value of 2.022 x 4.022 after normalizing the matrix andcalculating the maximum size. What are we doing wrong?
 
Hello Patrick & Gordon,


I attached the code and sample for your reference,I have some confusion do you require the view matrix to compute the ProSolidOutlineCompute(),As per the Pro/Toolkit documentation you require the trasformation ofCsys.


I follwed the matrix w.r.t to the Csys.Still i am getting the wrong results if i calculate outline dimension of the given solid part w.r.t to the default Csys.


SoildOutline_WithCsys function in my sample code attached,where Part-I and Part-II commented,open one at time and results are captured in the text file.


Part-1 works on ProSolidOutlineGet() and Part-II works on ProSolidOutlineCompute(). Ideally both has to give the same results but it is differ for one of the dimensions of the Outline.I provided the same to PTC,they rised SPR on this issue.


I attached the sample part on which i run the application gives the variation in the outline dimensions.


Plz go through the code and if you have any resolutions let me know.


With regards,


Kishore V
 
Kishorev,


The API documentation for ProSolidOutlineCompute does NOT require the transformation of a Csys. You only need to have the view orientation matrix. Also, I noticed in your code that you are using ProSolidOutlineGet rather than ProSolidOutlineCompute. My suggestion was to use the Compute API not the Get API. I have not ever experienced a situation where ProSolidOutlineCompute returned erroneous values.
 
2008-05-07_014852_Solid_Outline_Test.zip


Hello Patrick,


I was done as per your comments to take the ProView and use the transformation matrix.The results are same if you take the view to the respective part or the Csys located at the respective location form where you are find the outline.


But the issue here is when i run on my sample parts in my previous post,it give the wrong results for one of the values(especially round solid parts).For round parts two outline values must be equal.When i use the Compute API, it getas deviated after the decimal value.If you want to try,create a revolve part and run the application or try to get the outline values.First time it give the correct values.If you modify the diameter value then again run the application on it.You will observe the deviation of the diameter value in outline.


With regards,


Kishore V
 

Sponsor

Back
Top