Hi,
I am playing with the "Adding iPart occurrences to an assembly API Sample" from the help file.
oStep=0 For iRow = 1 To iNumRows oStep = oStep + 10 ' Add a translation along X axis oPos.SetTranslation ThisApplication.TransientGeometry.CreateVector(0, oStep, 0) Dim oOcc As ComponentOccurrence Set oOcc = oOccs.AddiPartMember("C:\\temp\\iPartFactory.ipt ", oPos, iRow) Next
After insertion, I created a drawing and dimensioned between two occurences. Instead the value of 10 as I expected, I got a 100. I thought the drawing is working in cm.
It is a bit confused here as I have a program placing ipart in this same way. Sometimes I got 10, but othertimes I got 100.
Thanks for help.
John
Can you double check that the drawings are using the cm or mm as the default units? You can check the Document Settings->Standard tab->Active Standard to know which units the drawings use. Anyway even the drawing dimension display the 10 or 100 is because of the units, but the DrawingDimension.ModelValue should return the double with the cm as default length units, so you can check the ModelValue to make sure the values are correct or not.
Hi Rocky,
I started with the standard(mm).iam template, place the occurences in it with the sample code. Each occurence 10 apart from the other in one direction.Then use ansi (mm).idw template to make the drawing. I checked the Document Settings, all in mm. But,still i got the dimension between two occurences is 100. By double click on the '100' dimension value, i got the model value is 100.
The dimesnions of the model part are all right. Just the place where I placed is not right.
Regards,
John
If you checked the Model Value in UI and the default units is mm then you will get the dimension value is 100 mm, and from API if you use a double as length without units specified then it would use cm as default database units, so the 10 in the "oStep = oStep + 10" should mean 10 cm. If you check the dimension model value from API, i.e. DrawingDimension.ModelValue you will get value of 10.