Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

cm or mm in drawing?

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
883 Views, 4 Replies

cm or mm in drawing?

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

 

 

4 REPLIES 4
Message 2 of 5
YuhanZhang
in reply to: Anonymous

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.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 3 of 5
Anonymous
in reply to: YuhanZhang

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

Message 4 of 5
Anonymous
in reply to: Anonymous

the 10 in "oStep = oStep + 10" must be cm. Then all ok.

Message 5 of 5
YuhanZhang
in reply to: Anonymous

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.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report