Community
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
"Laurie Comerford" <
href="mailto:laurie@cadapps.com.au">laurie@cadapps.com.au> wrote in
message
href="news:66F715993B3D3F5F9616AA033B9AD6D5@in.WebX.maYIadrTaRb">news:66F715993B3D3F5F9616AA033B9......
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
"John Uhden" <
href="mailto:juhden@cadlantic.com">
size=2>juhden@cadlantic.com> wrote in
message
href="news:03B503E05545C728F105B056DB283DFF@in.WebX.maYIadrTaRb">
face=Arial
size=2>news:03B...
face=Arial size=2>...
> 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
> >
> >
>