Author Topic: setting DefaultValue  (Read 2531 times)

0 Members and 1 Guest are viewing this topic.

Bryco

  • Water Moccasin
  • Posts: 1883
setting DefaultValue
« on: July 08, 2009, 05:46:53 PM »
I would like to show feet and inches in the DefaultValue for  ed.GetDistance.   I see there is a  GetDefaultValueString but it is protected so I can't figure out how to use it.

Spike Wilbury

  • Guest
Re: setting DefaultValue
« Reply #1 on: July 08, 2009, 06:22:48 PM »
I would like to show feet and inches in the DefaultValue for  ed.GetDistance.   I see there is a  GetDefaultValueString but it is protected so I can't figure out how to use it.


Be careful with what I post.... lately have done a lot of mistakes.... (but this is the only way I will refresh my memory)

The below code works for me, but you need to set the units to architectural and dimzin to 3

Code: [Select]
Document doc = acadApp.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptDistanceOptions distPrmt = new PromptDistanceOptions("");
distPrmt.Message = "\nOffset distance: ";
distPrmt.DefaultValue = 96.0;
PromptDoubleResult offDist = ed.GetDistance(distPrmt);
if (offDist.Status != PromptStatus.OK) return;

Quote
Offset distance <8'-0">:

Bryco

  • Water Moccasin
  • Posts: 1883
Re: setting DefaultValue
« Reply #2 on: July 08, 2009, 06:56:17 PM »
Thanks Luis. Seems like the units setting is all that is required