Changing Unit type from cm to mm using VB

Changing Unit type from cm to mm using VB

Anonymous
Not applicable
1,237 Views
2 Replies
Message 1 of 3

Changing Unit type from cm to mm using VB

Anonymous
Not applicable

Hi All, 

Looking for some help, when I shrinkwrap out a drawing using the API, the return IPT is in cm when I need it in mm. I don't particularly want to use Ilogic as this is all controlled though VB. I believe I should be using "UnitsTypeEnum.kMillimeterLengthUnits" I just can't work out how it has be be written correctly. 

 

Below is a small snippet of where it will sit (I believe).

Thanks again for the help

 

            ShRDef.RemoveInternalParts = False
            ShRDef.RemovePartsBySize = False
            'ShRDef.RemovePartsSize = 5 'cm
            '''''''''''''''''''''''''''''''ShRDef.RemovePocketsMaxFaceLoopRange = 10 'cm
            ShRDef.RemovePocketsStyle = ShrinkwrapRemoveStyleEnum.kShrinkwrapRemoveByRange
            ShRDef.RenameComponent = True
            ShRDef.UseColorOverrideFromSourceComponent = True



            ShrComp = oPCD.ReferenceComponents.ShrinkwrapComponents.Add(ShRDef)


            <<<< Change Unit Type would sit here>>>


            'Save Documents and create DWG

            Dim activeDoc As Inventor.PartDocument
            activeDoc = _invApp.ActiveEditObject
            activeDoc.SaveAs(fileNameIPTS, True)
            activeDoc.SaveAs(fileNameShrink, True)
            activeDoc.Close(True)
            oDoc.Close(True)

 

0 Likes
Accepted solutions (1)
1,238 Views
2 Replies
Replies (2)
Message 2 of 3

JhoelForshav
Mentor
Mentor
Accepted solution

Hi @Anonymous 

Since you have only included a small portion of your code it's a bit difficult to follow...

Is activeDoc the document you save as a dwg? if you look at the document settings for that document, is it set to centimeters? If so maybe it helps to just change that setting before saving the document?

activeDoc.UnitsOfMeasure.LengthUnits = UnitsTypeEnum.kMillimeterLengthUnits

 

Message 3 of 3

Anonymous
Not applicable

Thankyou 🙂