style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">[
style="COLOR: #2b91af">CommandMethod(
style="COLOR: #a31515">"test")]
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="COLOR: blue">static void
blah()
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: #2b91af">ObjectId[] ids =
PointSelectionSet();
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: blue">if (ids == null)
return;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: #2b91af">Document doc =
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: #2b91af">Application.DocumentManager.MdiActiveDocument;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: blue">using (
style="COLOR: #2b91af">Transaction tr =
doc.TransactionManager.StartTransaction())
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes"> {
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
foreach (
style="COLOR: #2b91af">ObjectId id in
ids)
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
{
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
Entity e = (
style="COLOR: #2b91af">Entity)tr.GetObject(id,
style="COLOR: #2b91af">OpenMode.ForRead);
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
if (!(e
style="COLOR: blue">is
style="COLOR: #2b91af">DBPoint))
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
continue;
style="COLOR: green">//shouldn't happen with
filter.
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
DBPoint p = (
style="COLOR: #2b91af">DBPoint)e;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
//check out p.Position; p.X;
...
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
//if you don't need the entity for
testing.
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
//DBPoint p =
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
//(DBPoint)(Entity)tr.GetObject(id,
OpenMode.ForRead);
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
}
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes"> }
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="COLOR: blue">static ObjectId[]
PointSelectionSet()
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: #2b91af">Editor ed =
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: #2b91af">Application.DocumentManager.MdiActiveDocument.Editor;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: #2b91af">PromptSelectionResult psr;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: #2b91af">SelectionFilter sf =
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
new
style="COLOR: #2b91af">SelectionFilter
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
( new
style="COLOR: #2b91af">TypedValue[]
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
{ new
style="COLOR: #2b91af">TypedValue( (
style="COLOR: blue">int)
style="COLOR: #2b91af">DxfCode.Start,
style="COLOR: #a31515">"POINT") } );
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes"> psr =
ed.SelectAll(sf);
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
style="COLOR: blue">return psr.Value !=
style="COLOR: blue">null ?
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="mso-spacerun: yes">
psr.Value.GetObjectIds() :
style="COLOR: blue">null;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageGood
href="news:6092302@discussion.autodesk.com">news:6092302@discussion.autodesk.com...
afternoon. ¿it can be possible to get point coordinates or line coordinates
from a dwg file using .net language?. Im spanish, please, sorry for my poor
english.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<BillZndl> wrote in messagePaul,
href="news:6092518@discussion.autodesk.com">news:6092518@discussion.autodesk.com...
I'm on the web side and what you just posted looks like the source code for an
html page. Unreadable here. Bill
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">[CommandMethod("test")]
public
static void blah()
{
ObjectId[] ids =
PointSelectionSet();
if (ids == null) return;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
Document doc =
Application.DocumentManager.MdiActiveDocument;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
using (Transaction tr =
doc.TransactionManager.StartTransaction())
{
foreach (ObjectId id in
ids)
{
Entity e
= (Entity)tr.GetObject(id,
OpenMode.ForRead);
if (!(e is
DBPoint))
continue; //shouldn't happen with filter.
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
DBPoint p =
(DBPoint)e;
//check out p.Position; p.X;
...
//if
you don't need the entity for
testing.
//DBPoint p =
//(DBPoint)(Entity)tr.GetObject(id,
OpenMode.ForRead);
}
}
}
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public
static ObjectId[] PointSelectionSet()
{
Editor ed
=
Application.DocumentManager.MdiActiveDocument.Editor;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
PromptSelectionResult psr;
SelectionFilter sf
=
new
SelectionFilter
( new TypedValue[]
{
new TypedValue( (int)DxfCode.Start, "POINT") } );
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
psr = ed.SelectAll(sf);
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
return psr.Value != null ?
psr.Value.GetObjectIds() : null;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Paul Richardson" <prichardson<lastpoint> wrote in message
href="news:6092539@discussion.autodesk.com">news:6092539@discussion.autodesk.com...
Thanks Bill - looks great on the newsreader side.
I wish they fix this mess - I just don't get it. I won't even
read
most posts any longer as they are unreadable on
the newreader end... Here is a txt file.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<BillZndl> wrote in messagePaul,
href="news:6092518@discussion.autodesk.com">news:6092518@discussion.autodesk.com...
I'm on the web side and what you just posted looks like the source code for
an html page. Unreadable here.
Bill
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Paul Richardson" <prichardson<lastpoint> wrote in message
href="news:6092584@discussion.autodesk.com">news:6092584@discussion.autodesk.com...
They even grabled the txt file... Looks fine here
but if I download the txt I posted it's all on two lines.
wtf!~
Does this look any better?
[code]
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">[CommandMethod("test")]
public
static void blah()
{
ObjectId[] ids =
PointSelectionSet();
if (ids == null) return;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
Document doc =
Application.DocumentManager.MdiActiveDocument;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
using (Transaction tr =
doc.TransactionManager.StartTransaction())
{
foreach (ObjectId id in
ids)
{
Entity
e = (Entity)tr.GetObject(id,
OpenMode.ForRead);
if (!(e is
DBPoint))
continue; //shouldn't happen with filter.
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
DBPoint p =
(DBPoint)e;
//check out p.Position; p.X;
...
//if
you don't need the entity for
testing.
//DBPoint p =
//(DBPoint)(Entity)tr.GetObject(id,
OpenMode.ForRead);
}
}
}
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">public
static ObjectId[] PointSelectionSet()
{
Editor ed
=
Application.DocumentManager.MdiActiveDocument.Editor;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
PromptSelectionResult psr;
SelectionFilter sf
=
new
SelectionFilter
( new TypedValue[]
{
new TypedValue( (int)DxfCode.Start, "POINT") } );
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
psr = ed.SelectAll(sf);
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">
return psr.Value != null ?
psr.Value.GetObjectIds() : null;
style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none">
style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}
[/code]
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Paul Richardson" <prichardson<lastpoint> wrote in message
href="news:6092539@discussion.autodesk.com">news:6092539@discussion.autodesk.com...
Thanks Bill - looks great on the newsreader
side. I wish they fix this mess - I just don't get it. I won't even
read
most posts any longer as they are unreadable on
the newreader end... Here is a txt file.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<BillZndl> wrote in messagePaul,
href="news:6092518@discussion.autodesk.com">news:6092518@discussion.autodesk.com...
I'm on the web side and what you just posted looks like the source code
for an html page. Unreadable here.
Bill
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<BillZndl> wrote in messageThanks
href="news:6092626@discussion.autodesk.com">news:6092626@discussion.autodesk.com...
Paul! Between guessing if code is right and getting kicked off every 3
minutes, I should be able to copy by hand the .png image (What fun!!!).
Bill
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageGood
href="news:6092302@discussion.autodesk.com">news:6092302@discussion.autodesk.com...
afternoon. ¿it can be possible to get point coordinates or line coordinates
from a dwg file using .net language?. Im spanish, please, sorry for my poor
english.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageMany
href="news:6092707@discussion.autodesk.com">news:6092707@discussion.autodesk.com...
thanks to all. I have readed this code, but I have a doubt. If I can obtain
object property I must pick on it. It's possible to achieve identities (for
example, only points) of a dwg without picking on it?. I can obtain the layer
but I can't access to entities inside it. It's
possible?.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageMany
href="news:6093164@discussion.autodesk.com">news:6093164@discussion.autodesk.com...
thanks. I can obtain all I need. Only I need to know how get X-Y Coordinates
of a entity. Many thanks. I'ts very useful.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageGood
href="news:6092302@discussion.autodesk.com">news:6092302@discussion.autodesk.com...
afternoon. ¿it can be possible to get point coordinates or line coordinates
from a dwg file using .net language?. Im spanish, please, sorry for my poor
english.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageI
href="news:6093899@discussion.autodesk.com">news:6093899@discussion.autodesk.com...
have obtained all I needed. Many thanks to all for replies and help me. 😄 I
can post my code?.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Paul Richardson" <prichardson<lastpoint> wrote in message
href="news:6093912@discussion.autodesk.com">news:6093912@discussion.autodesk.com...
Sure - post how you did it so others can
see.
This idea works for me...
{code}
using (Transaction tr =
doc.TransactionManager.StartTransaction())
{
foreach
(ObjectId id in ids)
{
Entity e =
(Entity)tr.GetObject
(id, OpenMode.ForRead);
Line l
= e as Line;
if (l !=
null)
{
outPut
+=
(string.Format
("Line startpoint:{0}\n",
l.StartPoint));
continue;
}
DBPoint p = e as DBPoint;
if (p
!= null)
{
outPut
+=
(string.Format
("Point position:{0}\n",
p.Position));
continue;
}
//...
}
}
{code}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageI
href="news:6093899@discussion.autodesk.com">news:6093899@discussion.autodesk.com...
have obtained all I needed. Many thanks to all for replies and help me. 😄 I
can post my code?.
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Paul Richardson" <prichardson<lastpoint> wrote in message
href="news:6093914@discussion.autodesk.com">news:6093914@discussion.autodesk.com...
[code]
using (Transaction tr =
doc.TransactionManager.StartTransaction())
{
foreach
(ObjectId id in ids)
{
Entity e =
(Entity)tr.GetObject
(id, OpenMode.ForRead);
Line l
= e as Line;
if (l !=
null)
{
outPut
+=
(string.Format
("Line startpoint:{0}\n",
l.StartPoint));
continue;
}
DBPoint p = e as DBPoint;
if (p
!= null)
{
outPut
+=
(string.Format
("Point position:{0}\n",
p.Position));
continue;
}
//...
}
}
[/code]
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Paul Richardson" <prichardson<lastpoint> wrote in message
href="news:6093912@discussion.autodesk.com">news:6093912@discussion.autodesk.com...
Sure - post how you did it so others can
see.
This idea works for me...
{code}
using (Transaction tr =
doc.TransactionManager.StartTransaction())
{
foreach (ObjectId id in ids)
{
Entity e =
(Entity)tr.GetObject
(id, OpenMode.ForRead);
Line
l = e as Line;
if (l !=
null)
{
outPut
+=
(string.Format
("Line startpoint:{0}\n",
l.StartPoint));
continue;
}
DBPoint p = e as DBPoint;
if
(p != null)
{
outPut
+=
(string.Format
("Point position:{0}\n",
p.Position));
continue;
}
//...
}
}
{code}
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<Ethiel> wrote in messageI
href="news:6093899@discussion.autodesk.com">news:6093899@discussion.autodesk.com...
have obtained all I needed. Many thanks to all for replies and help me. 😄
I can post my
code?.