.NET

Reply
*Randy Richardson
Message 1 of 13 (210 Views)

RealToString (rtos)

210 Views, 12 Replies
09-20-2006 06:57 PM
AutoCAD 2007.

Is there an Autodesk-supplied RealToString or rtos function that turns a
double into a string formatted according to the lunits, luprec, and dimzin
system variables for .net?

Thanks,

Randy Richardson
Hattiesburg, MS
*Randy Richardson
Message 2 of 13 (210 Views)

Re: RealToString (rtos)

09-20-2006 08:41 PM in reply to: *Randy Richardson
OK, I've found it. I did a lot of exploring and searching and
experimenting.

Imports Autodesk.AutoCAD.ApplicationServices.Application

Dim acDoc As AcadDocument = DocumentManager.MdiActiveDocument.AcadDocument
Dim Dist1 As String = acDoc.Utility.RealToString(37.6875,
Common.AcUnits.acArchitectural, 4)

And... wow, I found the PolarPoint function the same place. Now I can
delete the polar function that I wrote from my program. Seems like this
stuff ought to be documented somewhere. Or am I missing something? It's
hard to find it in the right place if you don't know where the right place
is.

Randy Richardson
Hattiesburg, MS
*Randy Richardson
Message 3 of 13 (210 Views)

Re: RealToString (rtos)

09-20-2006 08:46 PM in reply to: *Randy Richardson
I guess this doesn't completely fill the bill of what I asked for, but close
enough. I can supply at least the values of lunits and luprec as the
arguments. The dimzin maybe isn't a big enough deal to worry about.

I'd still like to know if this stuff is documented anywhere....?

Randy Richardson
Hattiesburg, MS
*Tony Tanzillo
Message 4 of 13 (210 Views)

Re: RealToString (rtos)

09-20-2006 09:49 PM in reply to: *Randy Richardson
You're referring to methods of the ActiveX object model.

There's plenty of docs on that.

The managed (.NET) counterpart is:

Autodesk.AutoCAD.Runtime.Converter

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"Randy Richardson" wrote in message news:5336385@discussion.autodesk.com...
I guess this doesn't completely fill the bill of what I asked for, but close
enough. I can supply at least the values of lunits and luprec as the
arguments. The dimzin maybe isn't a big enough deal to worry about.

I'd still like to know if this stuff is documented anywhere....?

Randy Richardson
Hattiesburg, MS
Mentor
MarkPendergraft
Posts: 375
Registered: ‎06-27-2005
Message 5 of 13 (210 Views)

Re: RealToString (rtos)

09-21-2006 09:46 AM in reply to: *Randy Richardson
your right Randy, there is not that much documentation on .NET. The ActiveX model is well documented, but .NET isn't. Besides the training labs, the best bet is to experiment, and search online extensively.
*Randy Richardson
Message 6 of 13 (210 Views)

Re: RealToString (rtos)

09-21-2006 08:20 PM in reply to: *Randy Richardson
Tony, thanks for your reply. I hadn't realized that ActiveX was accessible
from .NET, I guess I should have known. You opened a whole new world to me.
However, using the managed (.NET) counterpart that you mentioned, I see one
obvious difference: simplicity of the coding. The code that I posted before
can be simplified to:

Dim Dist1 As String =
Autodesk.AutoCAD.Runtime.Converter.DistanceToString(37.6875,
DistanceUnitFormat.Architectural, 4)

I like not having to mess with the AcadDocument--saves a step anyhow.

Are the managed (.NET) counterparts to ActiveX documented anywhere? If not,
that's one point for ActiveX. In summary, one point for ActiveX
(documentation), and one point for the managed (.NET) counterparts
(simplicity).

Other than that, what are the pros and cons of using one system or the
other?

Thanks,

Randy


"Tony Tanzillo" wrote in message
news:5336418@discussion.autodesk.com...
You're referring to methods of the ActiveX object model.

There's plenty of docs on that.

The managed (.NET) counterpart is:

Autodesk.AutoCAD.Runtime.Converter

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
*Randy Richardson
Message 7 of 13 (210 Views)

Re: RealToString (rtos)

09-21-2006 08:24 PM in reply to: *Randy Richardson
Thanks for the reply, Cadkid82. Over the last few weeks I've gotten a lot
of experience with experimenting and searching online. I don't know if I've
gotten any better at experimenting and searching online, but at least
perhaps I'm getting more used to doing them for what that's worth.

wrote in message news:5337132@discussion.autodesk.com...
your right Randy, there is not that much documentation on .NET. The ActiveX
model is well documented, but .NET isn't. Besides the training labs, the
best bet is to experiment, and search online extensively.
*Paul Richardson
Message 8 of 13 (210 Views)

Re: RealToString (rtos)

09-22-2006 05:17 AM in reply to: *Randy Richardson
Use the 'Object Browser'. You can filter your search just on the
Acad Libraries. Then search on what you're looking for. In this
case searching for 'Converter' would have given you the answer.
The nice thing is the Libraries are named intuitively in most cases.

"Randy Richardson" wrote in message
news:5337737@discussion.autodesk.com...
Tony, thanks for your reply. I hadn't realized that ActiveX was accessible
from .NET, I guess I should have known. You opened a whole new world to me.
However, using the managed (.NET) counterpart that you mentioned, I see one
obvious difference: simplicity of the coding. The code that I posted before
can be simplified to:

Dim Dist1 As String =
Autodesk.AutoCAD.Runtime.Converter.DistanceToString(37.6875,
DistanceUnitFormat.Architectural, 4)

I like not having to mess with the AcadDocument--saves a step anyhow.

Are the managed (.NET) counterparts to ActiveX documented anywhere? If not,
that's one point for ActiveX. In summary, one point for ActiveX
(documentation), and one point for the managed (.NET) counterparts
(simplicity).

Other than that, what are the pros and cons of using one system or the
other?

Thanks,

Randy


"Tony Tanzillo" wrote in message
news:5336418@discussion.autodesk.com...
You're referring to methods of the ActiveX object model.

There's plenty of docs on that.

The managed (.NET) counterpart is:

Autodesk.AutoCAD.Runtime.Converter

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com
*Randy Richardson
Message 9 of 13 (210 Views)

Re: RealToString (rtos)

09-22-2006 06:40 PM in reply to: *Randy Richardson
Paul, thanks for pointing out the object browser, I hadn't understood that.
I'm sure I'll use it a lot. But I fear that "intuitive" is in the eye of
the beholder. Most of what I see in the object browser looks pretty
baffling. I should have learned this stuff before writing 1800 lines of an
AutoCAD-based program in VB.NET, but I seem to learn more when I'm doing.

Randy Richardson
Hattiesburg, MS

"Paul Richardson" wrote in message
news:5337929@discussion.autodesk.com...
Use the 'Object Browser'. You can filter your search just on the
Acad Libraries. Then search on what you're looking for. In this
case searching for 'Converter' would have given you the answer.
The nice thing is the Libraries are named intuitively in most cases.
*Paul Richardson
Message 10 of 13 (210 Views)

Re: RealToString (rtos)

09-23-2006 01:51 AM in reply to: *Randy Richardson
You're welcome. It gets easier... :smileyhappy:

"Randy Richardson" wrote in message
news:5338924@discussion.autodesk.com...
Paul, thanks for pointing out the object browser, I hadn't understood that.
I'm sure I'll use it a lot. But I fear that "intuitive" is in the eye of
the beholder. Most of what I see in the object browser looks pretty
baffling. I should have learned this stuff before writing 1800 lines of an
AutoCAD-based program in VB.NET, but I seem to learn more when I'm doing.

Randy Richardson
Hattiesburg, MS

"Paul Richardson" wrote in message
news:5337929@discussion.autodesk.com...
Use the 'Object Browser'. You can filter your search just on the
Acad Libraries. Then search on what you're looking for. In this
case searching for 'Converter' would have given you the answer.
The nice thing is the Libraries are named intuitively in most cases.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community