Prod.: Engine, ver.: 6, ID: 60001533, HowTo : How can I ask the user to input a distance in Architectural units (inches feet)

HowTo : How can I ask the user to input a distance in Architectural units (inches feet)

Article60001533
TypeHowTo
ProductEngine
Version6
Date Added11/4/2011
Submitted byBryan Gilbert
Keywords

Subject

How can I ask the user to input a distance in Architectural units (inches feet)

Summary

How can I ask the user to input a distance in Architectural units (inches feet)

Solution

You can do this using a code like :
            vdDoc.lunits.UType = LUnits.LUnitType.lu_Architectural; // the coordinates are displayed in Architectural units (feet inches etc)
..................
            double distance;
            string userInput = vdDoc.ActionUtility.getUserString(); // user inputs 1'-12"
            distance = vdFramedControl1.BaseControl.ActiveDocument.lunits.LengthFromString(userInput); // and this is translated in D.U decimal

            MessageBox.Show("user typed: ' "+ userInput +" ' , while the value LengthFromString returned the double: "+distance.ToString());