Automate Topology creation

Automate Topology creation

Anonymous
Not applicable
643 Views
6 Replies
Message 1 of 7

Automate Topology creation

Anonymous
Not applicable
I want a way to do a series of command

Map--> Topology --> Create.

Map--> Object Data, detach from objet

Map --> Database --> generate links

Map--> Query--> topology thematic query.

This series of command that can take a few dozens of clicks, and I sometimes
have to repeat it a few times on several drawings, beeing able to program it
would greatly help me, I'm quite familiar with VBA and VB, but I can't find
good help on the map object.

Can someone here help me on this one.

Thanks.
0 Likes
644 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Hi,

Many of the AutoCAD commands can be typed with a starting "-" which calls
the command from the keyboard without a dialog box. From there you can
experiment to sort out the keyboard responses you need and feed all that
into a menu command (or a script file, which would probably be best as you
will be combing several commands sequentially)

After you get one command to work as you need simply sort out he process for
a second command, then you can append the two commands onto one menu item or
into the script file.

The first command you need "_MAPCREATE" didn't respond to "-MAPCREATE",
however after I set the FILEDIA and CMDDIA variables to 0 it worked without
the dialog box. See Text screen extract below. As you can see some of the
script data would need to be varied if you expect more than one topology to
be created.

--


Laurie Comerford
CADApps
www.cadapps.com.au


Command: _MAPCREATE
Command: -mapcreate
Unknown command "-MAPCREATE". Press F1 for help.

Command: filedia
Enter new value for FILEDIA <1>: 0

Command: cmddia

Enter new value for CMDDIA <1>: 0

Command: _mapcreate

Enter topology name: Fred

Enter topology description: It's a nice day to experiment

Enter topology type (Node/neTwork/Polygon)

: P

Filter selected node objects? (Yes/No) : N

Automatically select node objects? (Yes/No) : Y

Create new nodes? (Yes/No) : Y


Enter target layer for new nodes (? for list) <0>: Fred


Enter block for creating new nodes (? for list) :

Filter selected links? (Yes/No) :

Automatically select links? (Yes/No) :

Filter selected centroids? (Yes/No) :

Automatically select centroids? (Yes/No) :


Enter target layer for new centroids (? for list) <0>: FRED)


Enter block for creating new centroids (? for list) :
Automatically create missing centroids? :
Allow multiple centroids? (Yes/No) :
Allow incomplete areas? (Yes/No) :
Highlight Errors? (Yes/No) :
Mark Errors? (Yes/No) :

Creating Polygon topology: Fred....

Writing topology information to the drawing...

Topology successfully created.
"Yves Allaire" wrote in message
news:096107FDB4784F50874A69214881B0CD@in.WebX.maYIadrTaRb...
> I want a way to do a series of command
>
> Map--> Topology --> Create.
>
> Map--> Object Data, detach from objet
>
> Map --> Database --> generate links
>
> Map--> Query--> topology thematic query.
>
> This series of command that can take a few dozens of clicks, and I
sometimes
> have to repeat it a few times on several drawings, beeing able to program
it
> would greatly help me, I'm quite familiar with VBA and VB, but I can't
find
> good help on the map object.
>
> Can someone here help me on this one.
>
> Thanks.
>
>
>

0 Likes
Message 3 of 7

Anonymous
Not applicable
Thanks, but instead of using script, is there a way to call a command within
VBA, like we used to do with LISP.

Thanks.


"Laurie Comerford" a écrit dans le message de news:
DDB43F49BBBA7EDDBC9E9B9C680819E5@in.WebX.maYIadrTaRb...
> Hi,
>
> Many of the AutoCAD commands can be typed with a starting "-" which calls
> the command from the keyboard without a dialog box. From there you can
> experiment to sort out the keyboard responses you need and feed all that
> into a menu command (or a script file, which would probably be best as you
> will be combing several commands sequentially)
>
> After you get one command to work as you need simply sort out he process
for
> a second command, then you can append the two commands onto one menu item
or
> into the script file.
>
> The first command you need "_MAPCREATE" didn't respond to "-MAPCREATE",
> however after I set the FILEDIA and CMDDIA variables to 0 it worked
without
> the dialog box. See Text screen extract below. As you can see some of
the
> script data would need to be varied if you expect more than one topology
to
> be created.
>
> --
>
>
> Laurie Comerford
> CADApps
> www.cadapps.com.au
>
>
> Command: _MAPCREATE
> Command: -mapcreate
> Unknown command "-MAPCREATE". Press F1 for help.
>
> Command: filedia
> Enter new value for FILEDIA <1>: 0
>
> Command: cmddia
>
> Enter new value for CMDDIA <1>: 0
>
> Command: _mapcreate
>
> Enter topology name: Fred
>
> Enter topology description: It's a nice day to experiment
>
> Enter topology type (Node/neTwork/Polygon)

: P
>
> Filter selected node objects? (Yes/No) : N
>
> Automatically select node objects? (Yes/No) : Y
>
> Create new nodes? (Yes/No) : Y
>
>
> Enter target layer for new nodes (? for list) <0>: Fred
>
>
> Enter block for creating new nodes (? for list) :
>
> Filter selected links? (Yes/No) :
>
> Automatically select links? (Yes/No) :
>
> Filter selected centroids? (Yes/No) :
>
> Automatically select centroids? (Yes/No) :
>
>
> Enter target layer for new centroids (? for list) <0>: FRED)
>
>
> Enter block for creating new centroids (? for list) :
> Automatically create missing centroids? :
> Allow multiple centroids? (Yes/No) :
> Allow incomplete areas? (Yes/No) :
> Highlight Errors? (Yes/No) :
> Mark Errors? (Yes/No) :
>
> Creating Polygon topology: Fred....
>
> Writing topology information to the drawing...
>
> Topology successfully created.
> "Yves Allaire" wrote in message
> news:096107FDB4784F50874A69214881B0CD@in.WebX.maYIadrTaRb...
> > I want a way to do a series of command
> >
> > Map--> Topology --> Create.
> >
> > Map--> Object Data, detach from objet
> >
> > Map --> Database --> generate links
> >
> > Map--> Query--> topology thematic query.
> >
> > This series of command that can take a few dozens of clicks, and I
> sometimes
> > have to repeat it a few times on several drawings, beeing able to
program
> it
> > would greatly help me, I'm quite familiar with VBA and VB, but I can't
> find
> > good help on the map object.
> >
> > Can someone here help me on this one.
> >
> > Thanks.
> >
> >
> >
>
>

0 Likes
Message 4 of 7

Anonymous
Not applicable
Sorry, I found it... the Sendcommand method will do the work!


"Laurie Comerford" a écrit dans le message de news:
DDB43F49BBBA7EDDBC9E9B9C680819E5@in.WebX.maYIadrTaRb...
> Hi,
>
> Many of the AutoCAD commands can be typed with a starting "-" which calls
> the command from the keyboard without a dialog box. From there you can
> experiment to sort out the keyboard responses you need and feed all that
> into a menu command (or a script file, which would probably be best as you
> will be combing several commands sequentially)
>
> After you get one command to work as you need simply sort out he process
for
> a second command, then you can append the two commands onto one menu item
or
> into the script file.
>
> The first command you need "_MAPCREATE" didn't respond to "-MAPCREATE",
> however after I set the FILEDIA and CMDDIA variables to 0 it worked
without
> the dialog box. See Text screen extract below. As you can see some of
the
> script data would need to be varied if you expect more than one topology
to
> be created.
>
> --
>
>
> Laurie Comerford
> CADApps
> www.cadapps.com.au
>
>
> Command: _MAPCREATE
> Command: -mapcreate
> Unknown command "-MAPCREATE". Press F1 for help.
>
> Command: filedia
> Enter new value for FILEDIA <1>: 0
>
> Command: cmddia
>
> Enter new value for CMDDIA <1>: 0
>
> Command: _mapcreate
>
> Enter topology name: Fred
>
> Enter topology description: It's a nice day to experiment
>
> Enter topology type (Node/neTwork/Polygon)

: P
>
> Filter selected node objects? (Yes/No) : N
>
> Automatically select node objects? (Yes/No) : Y
>
> Create new nodes? (Yes/No) : Y
>
>
> Enter target layer for new nodes (? for list) <0>: Fred
>
>
> Enter block for creating new nodes (? for list) :
>
> Filter selected links? (Yes/No) :
>
> Automatically select links? (Yes/No) :
>
> Filter selected centroids? (Yes/No) :
>
> Automatically select centroids? (Yes/No) :
>
>
> Enter target layer for new centroids (? for list) <0>: FRED)
>
>
> Enter block for creating new centroids (? for list) :
> Automatically create missing centroids? :
> Allow multiple centroids? (Yes/No) :
> Allow incomplete areas? (Yes/No) :
> Highlight Errors? (Yes/No) :
> Mark Errors? (Yes/No) :
>
> Creating Polygon topology: Fred....
>
> Writing topology information to the drawing...
>
> Topology successfully created.
> "Yves Allaire" wrote in message
> news:096107FDB4784F50874A69214881B0CD@in.WebX.maYIadrTaRb...
> > I want a way to do a series of command
> >
> > Map--> Topology --> Create.
> >
> > Map--> Object Data, detach from objet
> >
> > Map --> Database --> generate links
> >
> > Map--> Query--> topology thematic query.
> >
> > This series of command that can take a few dozens of clicks, and I
> sometimes
> > have to repeat it a few times on several drawings, beeing able to
program
> it
> > would greatly help me, I'm quite familiar with VBA and VB, but I can't
> find
> > good help on the map object.
> >
> > Can someone here help me on this one.
> >
> > Thanks.
> >
> >
> >
>
>

0 Likes
Message 5 of 7

Anonymous
Not applicable
Hi Yves,

All of the information I provided before is still needed.

In the SendCommand process you still need to effectively create the Script
file (but as a string variable).

The only thing that you can do differently is use some preceding input in
the VBA to effectively write the script file to have different variables
such as the topo name.

You may even find it easiest in this case to use VBA to write the script
file and then run it.


--


Laurie Comerford
CADApps
www.cadapps.com.au


"Yves Allaire" wrote in message
news:4F86D5515B190F893D6BC69CE7C96A05@in.WebX.maYIadrTaRb...
> Sorry, I found it... the Sendcommand method will do the work!
>
>
> "Laurie Comerford" a écrit dans le message de
news:
> DDB43F49BBBA7EDDBC9E9B9C680819E5@in.WebX.maYIadrTaRb...
> > Hi,
> >
> > Many of the AutoCAD commands can be typed with a starting "-" which
calls
> > the command from the keyboard without a dialog box. From there you can
> > experiment to sort out the keyboard responses you need and feed all that
> > into a menu command (or a script file, which would probably be best as
you
> > will be combing several commands sequentially)
> >
> > After you get one command to work as you need simply sort out he process
> for
> > a second command, then you can append the two commands onto one menu
item
> or
> > into the script file.
> >
> > The first command you need "_MAPCREATE" didn't respond to "-MAPCREATE",
> > however after I set the FILEDIA and CMDDIA variables to 0 it worked
> without
> > the dialog box. See Text screen extract below. As you can see some of
> the
> > script data would need to be varied if you expect more than one topology
> to
> > be created.
> >
> > --
> >
> >
> > Laurie Comerford
> > CADApps
> > www.cadapps.com.au
> >
> >
> > Command: _MAPCREATE
> > Command: -mapcreate
> > Unknown command "-MAPCREATE". Press F1 for help.
> >
> > Command: filedia
> > Enter new value for FILEDIA <1>: 0
> >
> > Command: cmddia
> >
> > Enter new value for CMDDIA <1>: 0
> >
> > Command: _mapcreate
> >
> > Enter topology name: Fred
> >
> > Enter topology description: It's a nice day to experiment
> >
> > Enter topology type (Node/neTwork/Polygon)

: P
> >
> > Filter selected node objects? (Yes/No) : N
> >
> > Automatically select node objects? (Yes/No) : Y
> >
> > Create new nodes? (Yes/No) : Y
> >
> >
> > Enter target layer for new nodes (? for list) <0>: Fred
> >
> >
> > Enter block for creating new nodes (? for list) :
> >
> > Filter selected links? (Yes/No) :
> >
> > Automatically select links? (Yes/No) :
> >
> > Filter selected centroids? (Yes/No) :
> >
> > Automatically select centroids? (Yes/No) :
> >
> >
> > Enter target layer for new centroids (? for list) <0>: FRED)
> >
> >
> > Enter block for creating new centroids (? for list) :
> > Automatically create missing centroids? :
> > Allow multiple centroids? (Yes/No) :
> > Allow incomplete areas? (Yes/No) :
> > Highlight Errors? (Yes/No) :
> > Mark Errors? (Yes/No) :
> >
> > Creating Polygon topology: Fred....
> >
> > Writing topology information to the drawing...
> >
> > Topology successfully created.
> > "Yves Allaire" wrote in message
> > news:096107FDB4784F50874A69214881B0CD@in.WebX.maYIadrTaRb...
> > > I want a way to do a series of command
> > >
> > > Map--> Topology --> Create.
> > >
> > > Map--> Object Data, detach from objet
> > >
> > > Map --> Database --> generate links
> > >
> > > Map--> Query--> topology thematic query.
> > >
> > > This series of command that can take a few dozens of clicks, and I
> > sometimes
> > > have to repeat it a few times on several drawings, beeing able to
> program
> > it
> > > would greatly help me, I'm quite familiar with VBA and VB, but I can't
> > find
> > > good help on the map object.
> > >
> > > Can someone here help me on this one.
> > >
> > > Thanks.
> > >
> > >
> > >
> >
> >
>
>

0 Likes
Message 6 of 7

Anonymous
Not applicable
Thanks,

I tried the send command, it works fine, but only one simple thing, how can
I know if a specific topology exist.

Because if I try to delete a non existent topology, the script fails.

And further, I don't think that I'll do scripting, the following works:

doc.SendCommand "_MAPTOPOADMIN" & vbCr & "d" & vbCr & "test" & vbCr &
"y" & vbCr
doc.SendCommand "_ADEATTACHDATA" & vbCr & "geo" & vbCr & "detach" & vbCr
& "all" & vbCr

Or

Cmd = "_MAPTOPOADMIN" & vbCr & "d" & vbCr & "test" & vbCr & "y" & vbCr
doc.SendCommand Cmd

"Laurie Comerford" a écrit dans le message de news:
C863396CCD2FDFDBF0D26D04977236A3@in.WebX.maYIadrTaRb...
> Hi Yves,
>
> All of the information I provided before is still needed.
>
> In the SendCommand process you still need to effectively create the Script
> file (but as a string variable).
>
> The only thing that you can do differently is use some preceding input in
> the VBA to effectively write the script file to have different variables
> such as the topo name.
>
> You may even find it easiest in this case to use VBA to write the script
> file and then run it.
>
>
> --
>
>
> Laurie Comerford
> CADApps
> www.cadapps.com.au
>
>
> "Yves Allaire" wrote in message
> news:4F86D5515B190F893D6BC69CE7C96A05@in.WebX.maYIadrTaRb...
> > Sorry, I found it... the Sendcommand method will do the work!
> >
> >
> > "Laurie Comerford" a écrit dans le message de
> news:
> > DDB43F49BBBA7EDDBC9E9B9C680819E5@in.WebX.maYIadrTaRb...
> > > Hi,
> > >
> > > Many of the AutoCAD commands can be typed with a starting "-" which
> calls
> > > the command from the keyboard without a dialog box. From there you
can
> > > experiment to sort out the keyboard responses you need and feed all
that
> > > into a menu command (or a script file, which would probably be best as
> you
> > > will be combing several commands sequentially)
> > >
> > > After you get one command to work as you need simply sort out he
process
> > for
> > > a second command, then you can append the two commands onto one menu
> item
> > or
> > > into the script file.
> > >
> > > The first command you need "_MAPCREATE" didn't respond to
"-MAPCREATE",
> > > however after I set the FILEDIA and CMDDIA variables to 0 it worked
> > without
> > > the dialog box. See Text screen extract below. As you can see some
of
> > the
> > > script data would need to be varied if you expect more than one
topology
> > to
> > > be created.
> > >
> > > --
> > >
> > >
> > > Laurie Comerford
> > > CADApps
> > > www.cadapps.com.au
> > >
> > >
> > > Command: _MAPCREATE
> > > Command: -mapcreate
> > > Unknown command "-MAPCREATE". Press F1 for help.
> > >
> > > Command: filedia
> > > Enter new value for FILEDIA <1>: 0
> > >
> > > Command: cmddia
> > >
> > > Enter new value for CMDDIA <1>: 0
> > >
> > > Command: _mapcreate
> > >
> > > Enter topology name: Fred
> > >
> > > Enter topology description: It's a nice day to experiment
> > >
> > > Enter topology type (Node/neTwork/Polygon)

: P
> > >
> > > Filter selected node objects? (Yes/No) : N
> > >
> > > Automatically select node objects? (Yes/No) : Y
> > >
> > > Create new nodes? (Yes/No) : Y
> > >
> > >
> > > Enter target layer for new nodes (? for list) <0>: Fred
> > >
> > >
> > > Enter block for creating new nodes (? for list) :
> > >
> > > Filter selected links? (Yes/No) :
> > >
> > > Automatically select links? (Yes/No) :
> > >
> > > Filter selected centroids? (Yes/No) :
> > >
> > > Automatically select centroids? (Yes/No) :
> > >
> > >
> > > Enter target layer for new centroids (? for list) <0>: FRED)
> > >
> > >
> > > Enter block for creating new centroids (? for list) :
> > > Automatically create missing centroids? :
> > > Allow multiple centroids? (Yes/No) :
> > > Allow incomplete areas? (Yes/No) :
> > > Highlight Errors? (Yes/No) :
> > > Mark Errors? (Yes/No) :
> > >
> > > Creating Polygon topology: Fred....
> > >
> > > Writing topology information to the drawing...
> > >
> > > Topology successfully created.
> > > "Yves Allaire" wrote in message
> > > news:096107FDB4784F50874A69214881B0CD@in.WebX.maYIadrTaRb...
> > > > I want a way to do a series of command
> > > >
> > > > Map--> Topology --> Create.
> > > >
> > > > Map--> Object Data, detach from objet
> > > >
> > > > Map --> Database --> generate links
> > > >
> > > > Map--> Query--> topology thematic query.
> > > >
> > > > This series of command that can take a few dozens of clicks, and I
> > > sometimes
> > > > have to repeat it a few times on several drawings, beeing able to
> > program
> > > it
> > > > would greatly help me, I'm quite familiar with VBA and VB, but I
can't
> > > find
> > > > good help on the map object.
> > > >
> > > > Can someone here help me on this one.
> > > >
> > > > Thanks.
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>

0 Likes
Message 7 of 7

Anonymous
Not applicable
allaire, you can also use the Create.LSP tools that is included in the C:\Program Files\Autodesk Map 2004\Sample folder
0 Likes