AutoCAD Land Desktop (Read Only)
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

contour LabelPoints

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
198 Views, 8 Replies

contour LabelPoints

Hello all,

I'm trying to create a program that will record the location of all contour
labels of contours on a specific layer(s). I'm able to get the variant of
objContour.LabelPoints but I don't know how to store this information and
then combine it with all the other label points for all the other contours.
If anyone could shed some light on this subject for me or point me to a
place that shows me how to do this, I would be forever grateful (ok, at
least for the next week or so).

Brian

p.s. Here's what I have so far:

Public Sub CREATE_CONTOURS()
On Error Resume Next
Dim objCont As AeccContour
Dim varLabelPoint As Variant
Dim objSelSet As AcadSelectionSet
Dim objSelCol As AcadSelectionSets
Set objSelCol = ThisDrawing.SelectionSets
For Each objSelSet In objSelCol
If objSelSet.Name = "ContAnnot" Then
objSelSet.Delete
Exit For
End If
Next
Set objSelSet = objSelCol.Add("ContAnnot")
intType(0) = 0
varData(0) = "AECC_CONTOUR"
objSelSet.SelectOnScreen intType, varData
intcont2 = 0
For Each objCont In objSelSet
varLabelPoint = objCont.LabelPoints
' this is where the combining of varLabelPoint and the list of all
labels
' up to this point would occure
Next objCont
End Sub
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

I could help you with VisualLisp, but don't have the VBA knowledge to help you
out. Hopefully Laurie Comerford (a very congenial Aussie kinda guy knew that, but the lurkers might not>) can jump in.

--
John Uhden, Cadlantic/formerly CADvantage
http://www.cadlantic.com
Sea Girt, NJ


"Brian Hailey" wrote in message
news:7EDD59BC4AC65B20D5709B13D97C8911@in.WebX.maYIadrTaRb...
> Hello all,
>
> I'm trying to create a program that will record the location of all contour
> labels of contours on a specific layer(s). I'm able to get the variant of
> objContour.LabelPoints but I don't know how to store this information and
> then combine it with all the other label points for all the other contours.
> If anyone could shed some light on this subject for me or point me to a
> place that shows me how to do this, I would be forever grateful (ok, at
> least for the next week or so).
>
> Brian
>
> p.s. Here's what I have so far:
>
> Public Sub CREATE_CONTOURS()
> On Error Resume Next
> Dim objCont As AeccContour
> Dim varLabelPoint As Variant
> Dim objSelSet As AcadSelectionSet
> Dim objSelCol As AcadSelectionSets
> Set objSelCol = ThisDrawing.SelectionSets
> For Each objSelSet In objSelCol
> If objSelSet.Name = "ContAnnot" Then
> objSelSet.Delete
> Exit For
> End If
> Next
> Set objSelSet = objSelCol.Add("ContAnnot")
> intType(0) = 0
> varData(0) = "AECC_CONTOUR"
> objSelSet.SelectOnScreen intType, varData
> intcont2 = 0
> For Each objCont In objSelSet
> varLabelPoint = objCont.LabelPoints
> ' this is where the combining of varLabelPoint and the list of all
> labels
> ' up to this point would occure
> Next objCont
> End Sub
>
>
Message 3 of 9
Anonymous
in reply to: Anonymous

Hi Brian & John,

 

After praise like that how can I resist
?

 

This is an issue which I've wanted to tackle myself
to suit a client who has a very large DTM which gets changed in minor detail
regularly due to mining operations.  Each time they have to redo the
contours the old label locations are lost and it is hard for them to maintain
consistency of appearance in their drawings.

 

I'm assuming the purpose of the exercise is to
restore contour labels after recreating the contours as needed by the client
above.

 

I see two solutions.

An external data file

Writing to a dictionary in the drawing

 

The second will be harder as it has the learning
curve of creating dictionaries, writing to them and reading from them c.f.
writing to external files which most VBA users would find very
easy.

 

However, personally I think the exercise would be
worthwhile due to the ability to 'lose' external files when moving the drawing
to another computer etc.

 

There is sample code in the help files for creating
and using dictionaries, but I haven't had time to follow through to become
comfortable with doing it.

 

Things I'm unsure of:

 

Should you assemble the data into an array (or
preferably a collection) before writing it to the dictionary

Effect on drawing size and loading times
etc.

 

See also a couple more comments below.

 


--
Regards

 



> I could help you with VisualLisp, but don't
have the VBA knowledge to help you
> out.  Hopefully Laurie Comerford
(a very congenial Aussie kinda guy <yes, you
> knew that, but the
lurkers might not>) can jump in.
>
> --
> John Uhden,
Cadlantic/formerly CADvantage
>

href="http://www.cadlantic.com">
size=2>http://www.cadlantic.com

> Sea
Girt, NJ
>
>
> "Brian Hailey" <

href="mailto:jugglerbri@hotmail.com">
size=2>jugglerbri@hotmail.com
> wrote in
message
>

href="news:7EDD59BC4AC65B20D5709B13D97C8911@in.WebX.maYIadrTaRb">
face=Arial
size=2>news:7EDD59BC4...

face=Arial size=2>...
> > Hello all,
> >
> > I'm
trying to create a program that will record the location of all contour
>
> labels of contours on a specific layer(s).  I'm able to get the
variant of
> > objContour.LabelPoints but I don't know how to store
this information and
> > then combine it with all the other label
points for all the other contours.
> > If anyone could shed some light
on this subject for me or point me to a
> > place that shows me how to
do this, I would be forever grateful (ok, at
> > least for the next
week or so).
> >
> > Brian
> >
> > p.s.
Here's what I have so far:
> >


> > Public Sub
CREATE_CONTOURS()

 

I think you will have to
diminsion intType and varaData

Dim intType(0) as integer

Dim varData(0) as variant

 

or

 


Dim intType(0 to 1) as integer

Dim varData(0 to 1) as
variant

> >     On Error Resume
Next
> >     Dim objCont As AeccContour
>
>     Dim varLabelPoint As Variant
>
>     Dim objSelSet As AcadSelectionSet
>
>     Dim objSelCol As AcadSelectionSets
>
>     Set objSelCol = ThisDrawing.SelectionSets
>
>     For Each objSelSet In objSelCol
>
>         If objSelSet.Name =
"ContAnnot" Then
>
>            
objSelSet.Delete
>
>            
Exit For
> >         End
If
> >     Next
>
>     Set objSelSet = objSelCol.Add("ContAnnot")
>
>     intType(0) = 0
> >    
varData(0) = "AECC_CONTOUR"

 

Here you may be better off doing a
select all objects.  It depends on what you wish to do with the
data

Alternatively you could
add

    
intType(1) = 8
     varData(1) = "Comma separated layer
names inclusive of use of wild cards"

eg
color=#ff0000>"*cont-mnr,*cont-mjr"

> >     objSelSet.SelectOnScreen intType,
varData
> >     intcont2 = 0
>
>     For Each objCont In objSelSet
>
>         varLabelPoint =
objCont.LabelPoints
> >        
' this is where the combining of varLabelPoint and the list of all
> >
labels

 

Here you may wish to add the results to an array, or to
a collection for writing to the dictionary or external file


> >         ' up to this
point would occure
> >     Next objCont
>
> End Sub
> >
> >
>
Message 4 of 9
Anonymous
in reply to: Anonymous

Laurie,

 

Thanks for the info.  I am planning a routine
to relable the contours with the original label locations (just starting out
now).  When I come up with a finished product, I'll post it.  Perhaps
a little programming insight would be helpful.  This is the course of
action I see happening.  These would be two routines, the first would
harvest the label locations for contours on specific layers and the second would
relable the new contours after they were created.  I probably could combine
the harvest, create, and relable into one routine but I'm going to try to keep
it simple for now.

 

I like the idea of having the label locations
placed in an external file.  Do you know of any example code that shows how
to write information to a file?  Or a website that may have a
tutorial?  I'm still very new at this VBA thing (but I'm getting
better).

 

As always, thank you very much,

 

Brian


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

Hi Brian & John,

 

After praise like that how can I resist
?

 

This is an issue which I've wanted to tackle
myself to suit a client who has a very large DTM which gets changed in minor
detail regularly due to mining operations.  Each time they have to redo
the contours the old label locations are lost and it is hard for them to
maintain consistency of appearance in their drawings.

 

I'm assuming the purpose of the exercise is to
restore contour labels after recreating the contours as needed by the client
above.

 

I see two solutions.

An external data file

Writing to a dictionary in the
drawing

 

The second will be harder as it has the learning
curve of creating dictionaries, writing to them and reading from
them c.f. writing to external files which most VBA users would find very
easy.

 

However, personally I think the exercise would be
worthwhile due to the ability to 'lose' external files when moving the drawing
to another computer etc.

 

There is sample code in the help files for
creating and using dictionaries, but I haven't had time to follow through to
become comfortable with doing it.

 

Things I'm unsure of:

 

Should you assemble the data into an array (or
preferably a collection) before writing it to the dictionary

Effect on drawing size and loading times
etc.

 

See also a couple more comments
below.

 


--
Regards

 


Laurie Comerford
CADApps Australia
+61 3 9568 0077 ext
205
laurie@cadapps.com.au

href="http://www.cadapp.com.au">www.cadapp.com.au



> I could help you with VisualLisp, but don't
have the VBA knowledge to help you
> out.  Hopefully Laurie
Comerford (a very congenial Aussie kinda guy <yes, you
> knew that,
but the lurkers might not>) can jump in.
>
> --
> John
Uhden, Cadlantic/formerly CADvantage
>

href="http://www.cadlantic.com">
size=2>http://www.cadlantic.com

> Sea
Girt, NJ
>
>
> "Brian Hailey" <

href="mailto:jugglerbri@hotmail.com">
size=2>jugglerbri@hotmail.com
> wrote in
message
>

href="news:7EDD59BC4AC65B20D5709B13D97C8911@in.WebX.maYIadrTaRb">
face=Arial
size=2>news:7ED...

face=Arial size=2>...
> > Hello all,
> >
> > I'm
trying to create a program that will record the location of all
contour
> > labels of contours on a specific layer(s).  I'm able
to get the variant of
> > objContour.LabelPoints but I don't know how
to store this information and
> > then combine it with all the other
label points for all the other contours.
> > If anyone could shed
some light on this subject for me or point me to a
> > place that
shows me how to do this, I would be forever grateful (ok, at
> >
least for the next week or so).
> >
> > Brian
>
>
> > p.s. Here's what I have so far:
> >


> > Public Sub
CREATE_CONTOURS()

 

I think you will have to
diminsion intType and varaData

Dim intType(0) as integer

Dim varData(0) as variant

 

or

 


Dim intType(0 to 1) as integer

Dim varData(0 to 1) as
variant

> >     On Error
Resume Next
> >     Dim objCont As
AeccContour
> >     Dim varLabelPoint As
Variant
> >     Dim objSelSet As
AcadSelectionSet
> >     Dim objSelCol As
AcadSelectionSets
> >     Set objSelCol =
ThisDrawing.SelectionSets
> >     For Each
objSelSet In objSelCol
>
>         If objSelSet.Name =
"ContAnnot" Then
>
>            
objSelSet.Delete
>
>            
Exit For
> >         End
If
> >     Next
>
>     Set objSelSet =
objSelCol.Add("ContAnnot")
> >     intType(0) =
0
> >     varData(0) =
"AECC_CONTOUR"

 

Here you may be better off doing a
select all objects.  It depends on what you wish to do with the
data

Alternatively you could
add

    
intType(1) = 8
     varData(1) = "Comma separated layer
names inclusive of use of wild cards"

eg
color=#ff0000>"*cont-mnr,*cont-mjr"

> >     objSelSet.SelectOnScreen intType,
varData
> >     intcont2 = 0
>
>     For Each objCont In objSelSet
>
>         varLabelPoint =
objCont.LabelPoints
>
>         ' this is where the
combining of varLabelPoint and the list of all
> > labels

 

Here you may wish to add the results to an array, or
to a collection for writing to the dictionary or external file


> >         ' up to
this point would occure
> >     Next
objCont
> > End Sub
> >
> >
>
Message 5 of 9
Anonymous
in reply to: Anonymous

Hi Brian,

The help files can give you this type of code.

Here a few extracts
Writing Data to Files
When working with large amounts of data, it is often convenient to write
data to or read data from a file. The Open statement lets you create and
access files directly. Open provides three types of file access:
Sequential access (Input, Output, and Append modes) is used for writing text
files, such as error logs and reports.


Random access (Random mode) is used to read and write data to a file without
closing it. Random access files keep data in records, which makes it easy to
locate information quickly.


Binary access (Binary mode) is used to read or write to any byte position in
a file, such as storing or displaying a bitmap image.
Note The Open statement should not be used to open an application's own
file types. For example, don't use Open to open a Word document, a Microsoft
Excel spreadsheet, or a Microsoft Access database. Doing so will cause loss
of file integrity and file corruption.
The following table shows the statements typically used when writing data to
and reading data from files.
Access TypeWriting DataReading Data
SequentialPrint #, Write #Input #
RandomPutGet
BinaryPutGet


Open Statement Example
This example illustrates various uses of the Open statement to enable input
and output to a file.
The following code opens the file TESTFILE in sequential-input mode.
Dim i as Integer
i = Freefile
Open "TESTFILE" For Input As #i
' Close before reopening in another mode.Close #i
This code exmple opens the file for sequential output; any process can read
or write to file.
i = Freefile
Open "TESTFILE" For Output Shared As #i
' Close before reopening in another mode.
Close #i

For each contour you will have a random number of labels.
Hence in your code I would do the following
1 Build a string containing the coordinates of all the labels on a contour
Dim sCoords as String
sCoords = Format(East, "##.####") & "," & Format(North, "##.####") & "," &
Format(Elevation, "##.####") & ","
Print #i

When reading the data back
Dim vPts as variant
Input #i, sCoords

vPts = Split(sCoords, ",")

What I don't know is what will happen when you try to add a label to a
contour, which is not in the location it was when you saved the data, due to
a change in the DTM.

Have fun.

"Brian Hailey" wrote in message
news:F456025B50F222EC91028C560A35D652@in.WebX.maYIadrTaRb...
> Laurie,
>
> Thanks for the info. I am planning a routine to relable the contours with
the original label locations (just starting out now). When I come up with a
finished product, I'll post it. Perhaps a little programming insight would
be helpful. This is the course of action I see happening. These would be
two routines, the first would harvest the label locations for contours on
specific layers and the second would relable the new contours after they
were created. I probably could combine the harvest, create, and relable
into one routine but I'm going to try to keep it simple for now.
>
> I like the idea of having the label locations placed in an external file.
Do you know of any example code that shows how to write information to a
file? Or a website that may have a tutorial? I'm still very new at this
VBA thing (but I'm getting better).
>
> As always, thank you very much,
>
> Brian
> "Laurie Comerford" wrote in message
news:66F715993B3D3F5F9616AA033B9AD6D5@in.WebX.maYIadrTaRb...
> Hi Brian & John,
>
> After praise like that how can I resist ?
>
> This is an issue which I've wanted to tackle myself to suit a client who
has a very large DTM which gets changed in minor detail regularly due to
mining operations. Each time they have to redo the contours the old label
locations are lost and it is hard for them to maintain consistency of
appearance in their drawings.
>
> I'm assuming the purpose of the exercise is to restore contour labels
after recreating the contours as needed by the client above.
>
> I see two solutions.
> An external data file
> Writing to a dictionary in the drawing
>
> The second will be harder as it has the learning curve of creating
dictionaries, writing to them and reading from them c.f. writing to external
files which most VBA users would find very easy.
>
> However, personally I think the exercise would be worthwhile due to the
ability to 'lose' external files when moving the drawing to another computer
etc.
>
> There is sample code in the help files for creating and using
dictionaries, but I haven't had time to follow through to become comfortable
with doing it.
>
> Things I'm unsure of:
>
> Should you assemble the data into an array (or preferably a collection)
before writing it to the dictionary
> Effect on drawing size and loading times etc.
>
> See also a couple more comments below.
>
>
> --
> Regards
>
>
> Laurie Comerford
> CADApps Australia
> +61 3 9568 0077 ext 205
> laurie@cadapps.com.au
> www.cadapp.com.au
>
> "John Uhden" wrote in message
news:03B503E05545C728F105B056DB283DFF@in.WebX.maYIadrTaRb...
> > I could help you with VisualLisp, but don't have the VBA knowledge to
help you
> > out. Hopefully Laurie Comerford (a very congenial Aussie kinda guy
> > knew that, but the lurkers might not>) can jump in.
> >
> > --
> > John Uhden, Cadlantic/formerly CADvantage
> > http://www.cadlantic.com
> > Sea Girt, NJ
> >
> >
> > "Brian Hailey" wrote in message
> > news:7EDD59BC4AC65B20D5709B13D97C8911@in.WebX.maYIadrTaRb...
> > > Hello all,
> > >
> > > I'm trying to create a program that will record the location of all
contour
> > > labels of contours on a specific layer(s). I'm able to get the
variant of
> > > objContour.LabelPoints but I don't know how to store this
information and
> > > then combine it with all the other label points for all the other
contours.
> > > If anyone could shed some light on this subject for me or point me
to a
> > > place that shows me how to do this, I would be forever grateful (ok,
at
> > > least for the next week or so).
> > >
> > > Brian
> > >
> > > p.s. Here's what I have so far:
> > >
>
> > > Public Sub CREATE_CONTOURS()
>
> I think you will have to diminsion intType and varaData
> Dim intType(0) as integer
> Dim varData(0) as variant
>
> or
>
> Dim intType(0 to 1) as integer
> Dim varData(0 to 1) as variant
>
> > > On Error Resume Next
> > > Dim objCont As AeccContour
> > > Dim varLabelPoint As Variant
> > > Dim objSelSet As AcadSelectionSet
> > > Dim objSelCol As AcadSelectionSets
> > > Set objSelCol = ThisDrawing.SelectionSets
> > > For Each objSelSet In objSelCol
> > > If objSelSet.Name = "ContAnnot" Then
> > > objSelSet.Delete
> > > Exit For
> > > End If
> > > Next
> > > Set objSelSet = objSelCol.Add("ContAnnot")
> > > intType(0) = 0
> > > varData(0) = "AECC_CONTOUR"
>
> Here you may be better off doing a select all objects. It depends on
what you wish to do with the data
> Alternatively you could add
> intType(1) = 8
> varData(1) = "Comma separated layer names inclusive of use of wild
cards"
> eg "*cont-mnr,*cont-mjr"
>
> > > objSelSet.SelectOnScreen intType, varData
> > > intcont2 = 0
> > > For Each objCont In objSelSet
> > > varLabelPoint = objCont.LabelPoints
> > > ' this is where the combining of varLabelPoint and the list
of all
> > > labels
>
> Here you may wish to add the results to an array, or to a collection for
writing to the dictionary or external file
>
> > > ' up to this point would occure
> > > Next objCont
> > > End Sub
> > >
> > >
> >
Message 6 of 9
Anonymous
in reply to: Anonymous

Thanks for the help, Laurie. You've definitely given me the spring board to
jump into this project. I'm sure I'll be back with more questions as I get
deeper into it.

Brian

"Laurie Comerford" wrote in message
news:7E8D2D14A617103DEADD6895AD4A871C@in.WebX.maYIadrTaRb...
> Hi Brian,
>
> The help files can give you this type of code.
>
> Here a few extracts
> Writing Data to Files
> When working with large amounts of data, it is often convenient to write
> data to or read data from a file. The Open statement lets you create and
> access files directly. Open provides three types of file access:
> Sequential access (Input, Output, and Append modes) is used for writing
text
> files, such as error logs and reports.
>
>
> Random access (Random mode) is used to read and write data to a file
without
> closing it. Random access files keep data in records, which makes it easy
to
> locate information quickly.
>
>
> Binary access (Binary mode) is used to read or write to any byte position
in
> a file, such as storing or displaying a bitmap image.
> Note The Open statement should not be used to open an application's own
> file types. For example, don't use Open to open a Word document, a
Microsoft
> Excel spreadsheet, or a Microsoft Access database. Doing so will cause
loss
> of file integrity and file corruption.
> The following table shows the statements typically used when writing data
to
> and reading data from files.
> Access TypeWriting DataReading Data
> SequentialPrint #, Write #Input #
> RandomPutGet
> BinaryPutGet
>
>
> Open Statement Example
> This example illustrates various uses of the Open statement to enable
input
> and output to a file.
> The following code opens the file TESTFILE in sequential-input mode.
> Dim i as Integer
> i = Freefile
> Open "TESTFILE" For Input As #i
> ' Close before reopening in another mode.Close #i
> This code exmple opens the file for sequential output; any process can
read
> or write to file.
> i = Freefile
> Open "TESTFILE" For Output Shared As #i
> ' Close before reopening in another mode.
> Close #i
>
> For each contour you will have a random number of labels.
> Hence in your code I would do the following
> 1 Build a string containing the coordinates of all the labels on a
contour
> Dim sCoords as String
> sCoords = Format(East, "##.####") & "," & Format(North, "##.####") & "," &
> Format(Elevation, "##.####") & ","
> Print #i
>
> When reading the data back
> Dim vPts as variant
> Input #i, sCoords
>
> vPts = Split(sCoords, ",")
>
> What I don't know is what will happen when you try to add a label to a
> contour, which is not in the location it was when you saved the data, due
to
> a change in the DTM.
>
> Have fun.
>
> "Brian Hailey" wrote in message
> news:F456025B50F222EC91028C560A35D652@in.WebX.maYIadrTaRb...
> > Laurie,
> >
> > Thanks for the info. I am planning a routine to relable the contours
with
> the original label locations (just starting out now). When I come up with
a
> finished product, I'll post it. Perhaps a little programming insight
would
> be helpful. This is the course of action I see happening. These would be
> two routines, the first would harvest the label locations for contours on
> specific layers and the second would relable the new contours after they
> were created. I probably could combine the harvest, create, and relable
> into one routine but I'm going to try to keep it simple for now.
> >
> > I like the idea of having the label locations placed in an external
file.
> Do you know of any example code that shows how to write information to a
> file? Or a website that may have a tutorial? I'm still very new at this
> VBA thing (but I'm getting better).
> >
> > As always, thank you very much,
> >
> > Brian
> > "Laurie Comerford" wrote in message
> news:66F715993B3D3F5F9616AA033B9AD6D5@in.WebX.maYIadrTaRb...
> > Hi Brian & John,
> >
> > After praise like that how can I resist ?
> >
> > This is an issue which I've wanted to tackle myself to suit a client
who
> has a very large DTM which gets changed in minor detail regularly due to
> mining operations. Each time they have to redo the contours the old label
> locations are lost and it is hard for them to maintain consistency of
> appearance in their drawings.
> >
> > I'm assuming the purpose of the exercise is to restore contour labels
> after recreating the contours as needed by the client above.
> >
> > I see two solutions.
> > An external data file
> > Writing to a dictionary in the drawing
> >
> > The second will be harder as it has the learning curve of creating
> dictionaries, writing to them and reading from them c.f. writing to
external
> files which most VBA users would find very easy.
> >
> > However, personally I think the exercise would be worthwhile due to
the
> ability to 'lose' external files when moving the drawing to another
computer
> etc.
> >
> > There is sample code in the help files for creating and using
> dictionaries, but I haven't had time to follow through to become
comfortable
> with doing it.
> >
> > Things I'm unsure of:
> >
> > Should you assemble the data into an array (or preferably a
collection)
> before writing it to the dictionary
> > Effect on drawing size and loading times etc.
> >
> > See also a couple more comments below.
> >
> >
> > --
> > Regards
> >
> >
> > Laurie Comerford
> > CADApps Australia
> > +61 3 9568 0077 ext 205
> > laurie@cadapps.com.au
> > www.cadapp.com.au
> >
> > "John Uhden" wrote in message
> news:03B503E05545C728F105B056DB283DFF@in.WebX.maYIadrTaRb...
> > > I could help you with VisualLisp, but don't have the VBA knowledge
to
> help you
> > > out. Hopefully Laurie Comerford (a very congenial Aussie kinda guy
> > > > knew that, but the lurkers might not>) can jump in.
> > >
> > > --
> > > John Uhden, Cadlantic/formerly CADvantage
> > > http://www.cadlantic.com
> > > Sea Girt, NJ
> > >
> > >
> > > "Brian Hailey" wrote in message
> > > news:7EDD59BC4AC65B20D5709B13D97C8911@in.WebX.maYIadrTaRb...
> > > > Hello all,
> > > >
> > > > I'm trying to create a program that will record the location of
all
> contour
> > > > labels of contours on a specific layer(s). I'm able to get the
> variant of
> > > > objContour.LabelPoints but I don't know how to store this
> information and
> > > > then combine it with all the other label points for all the other
> contours.
> > > > If anyone could shed some light on this subject for me or point me
> to a
> > > > place that shows me how to do this, I would be forever grateful
(ok,
> at
> > > > least for the next week or so).
> > > >
> > > > Brian
> > > >
> > > > p.s. Here's what I have so far:
> > > >
> >
> > > > Public Sub CREATE_CONTOURS()
> >
> > I think you will have to diminsion intType and varaData
> > Dim intType(0) as integer
> > Dim varData(0) as variant
> >
> > or
> >
> > Dim intType(0 to 1) as integer
> > Dim varData(0 to 1) as variant
> >
> > > > On Error Resume Next
> > > > Dim objCont As AeccContour
> > > > Dim varLabelPoint As Variant
> > > > Dim objSelSet As AcadSelectionSet
> > > > Dim objSelCol As AcadSelectionSets
> > > > Set objSelCol = ThisDrawing.SelectionSets
> > > > For Each objSelSet In objSelCol
> > > > If objSelSet.Name = "ContAnnot" Then
> > > > objSelSet.Delete
> > > > Exit For
> > > > End If
> > > > Next
> > > > Set objSelSet = objSelCol.Add("ContAnnot")
> > > > intType(0) = 0
> > > > varData(0) = "AECC_CONTOUR"
> >
> > Here you may be better off doing a select all objects. It depends on
> what you wish to do with the data
> > Alternatively you could add
> > intType(1) = 8
> > varData(1) = "Comma separated layer names inclusive of use of
wild
> cards"
> > eg "*cont-mnr,*cont-mjr"
> >
> > > > objSelSet.SelectOnScreen intType, varData
> > > > intcont2 = 0
> > > > For Each objCont In objSelSet
> > > > varLabelPoint = objCont.LabelPoints
> > > > ' this is where the combining of varLabelPoint and the
list
> of all
> > > > labels
> >
> > Here you may wish to add the results to an array, or to a collection
for
> writing to the dictionary or external file
> >
> > > > ' up to this point would occure
> > > > Next objCont
> > > > End Sub
> > > >
> > > >
> > >
>
>
Message 7 of 9
Anonymous
in reply to: Anonymous

Ok,

I've figured out how to write the label coordinates to a file but, if the
file already exists, how do I get rid of all the data that is already in it?
Or can I simply delete the file?

Thanks,

Brian
Message 8 of 9
Anonymous
in reply to: Anonymous

There are a lot of help files out there for this VBA thing. I guess I just
needed to look in the right one. I'm using the deletefile method (if
someone knows of something better, please let me know).

Brian

"Brian Hailey" wrote in message
news:CBD964DDE3D752CB71DFF0C8E65C6063@in.WebX.maYIadrTaRb...
> Ok,
>
> I've figured out how to write the label coordinates to a file but, if the
> file already exists, how do I get rid of all the data that is already in
it?
> Or can I simply delete the file?
>
> Thanks,
>
> Brian
>
>
Message 9 of 9
Anonymous
in reply to: Anonymous

I think the answer is to open for "write" not "append."

--
John Uhden, Cadlantic/formerly CADvantage
http://www.cadlantic.com
Sea Girt, NJ


"Brian Hailey" wrote in message
news:CBD964DDE3D752CB71DFF0C8E65C6063@in.WebX.maYIadrTaRb...
> Ok,
>
> I've figured out how to write the label coordinates to a file but, if the
> file already exists, how do I get rid of all the data that is already in it?
> Or can I simply delete the file?
>
> Thanks,
>
> Brian
>
>

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

Post to forums  

Autodesk Design & Make Report