Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Login
Register
TheSwamp
»
Code Red
»
.NET
»
Topic:
How can I assign all Cogo Points to an array?
« previous
next »
Print
Pages: [
1
] |
Go Down
Author
Topic: How can I assign all Cogo Points to an array? (Read 1265 times)
0 Members and 1 Guest are viewing this topic.
ekoneo
Newt
Posts: 66
How can I assign all Cogo Points to an array?
«
on:
April 24, 2014, 03:13:32 AM »
Anybody know that assigning all cogo points to an array?
Such as MyCogoARRAY.
Then I want to use that array MyCogoARRAY[5] that returning 5th cogo point's number or other properties.
Are there any way to do that?
Logged
Jeff_M
King Gator
Posts: 4096
C3D user & customizer
Re: How can I assign all Cogo Points to an array?
«
Reply #1 on:
April 24, 2014, 08:59:49 AM »
Code - C#:
[Select]
CivilDocument civdoc
=
CivilApplication
.
ActiveDocument
;
Document doc
=
acadApp
.
DocumentManager
.
MdiActiveDocument
;
Editor ed
=
doc
.
Editor
;
Database db
=
doc
.
Database
;
using
(
Transaction tr
=
db
.
TransactionManager
.
StartTransaction
(
)
)
{
PointGroup pg
=
(
PointGroup
)
civdoc
.
PointGroups
[
"_All Points"
]
.
GetObject
(
OpenMode
.
ForRead
)
;
uint
[
]
pointnums
=
pg
.
GetPointNumbers
(
)
;
//the array of Point #'s is not in any particular order, so convert to List & Sort...requires a using for Linq
List
<
uint
>
ptlist
=
pointnums
.
ToList
<
uint
>
(
)
;
ptlist
.
Sort
(
)
;
//if an array is really needed instead of the now sorted List, convert back to an array
pointnums
=
ptlist
.
ToArray
(
)
;
tr
.
Commit
(
)
;
}
Logged
ekoneo
Newt
Posts: 66
Re: How can I assign all Cogo Points to an array?
«
Reply #2 on:
April 24, 2014, 10:05:13 AM »
Thanks again thanks thousands of thanks Jeff_M;
It works..
Thank you..
Logged
Print
Pages: [
1
] |
Go Up
« previous
next »
TheSwamp
»
Code Red
»
.NET
»
Topic:
How can I assign all Cogo Points to an array?