.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RealToString (rtos)

12 REPLIES 12
Reply
Message 1 of 13
Anonymous
577 Views, 12 Replies

RealToString (rtos)

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
12 REPLIES 12
Message 2 of 13
Anonymous
in reply to: Anonymous

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
Message 3 of 13
Anonymous
in reply to: Anonymous

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
Message 4 of 13
Anonymous
in reply to: Anonymous

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
Message 5 of 13
MarkPendergraft
in reply to: Anonymous

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.
Message 6 of 13
Anonymous
in reply to: Anonymous

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
Message 7 of 13
Anonymous
in reply to: Anonymous

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.
Message 8 of 13
Anonymous
in reply to: Anonymous

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
Message 9 of 13
Anonymous
in reply to: Anonymous

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.
Message 10 of 13
Anonymous
in reply to: Anonymous

You're welcome. It gets easier... 🙂

"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.
Message 11 of 13
Anonymous
in reply to: Anonymous

The object model is fairly large, and certainly not
intuitive. It is also an API that was not primarily
targeted at weekend-programmers that have a day
job.

You will not always find what you're looking for
without utilizing the tools available (for example,
the Search function of the object browser).

Open the object browser, and in the search box
enter "Convert" and click the search button. You'll
find plenty of results, but what you are looking for
is there in the result list.

That's where the 'intuitive' part comes in.

I've found that knowing what tools I have, and
how use them helps immensely when it comes to
finding answers.

--
http://www.caddzone.com

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

"Paul Richardson" wrote in message news:5339006@discussion.autodesk.com...
You're welcome. It gets easier... 🙂

"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.
Message 12 of 13
Anonymous
in reply to: Anonymous

Randy,
Download the ObjectARX SDK. I put a shortcut to the docs right on my
desktop.
--
Bobby C. Jones
Message 13 of 13
Anonymous
in reply to: Anonymous

Thanks for the tip, Bobby. I pored over the ObjectARX SDK docs before I
started this thread, but I could not find anything therein to help me. Did
I overlook something?

Randy Richardson
Hattiesburg, MS

"Bobby C. Jones" wrote in message
news:5340021@discussion.autodesk.com...
Randy,
Download the ObjectARX SDK. I put a shortcut to the docs right on my
desktop.
--
Bobby C. Jones

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost