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

Code for "Alignment Librarian"

11 REPLIES 11
Reply
Message 1 of 12
Anonymous
308 Views, 11 Replies

Code for "Alignment Librarian"

Hi,
Does anyone know how to call up the "alignment librarian" in your vba
project?
TIA,
-Kirsten
11 REPLIES 11
Message 2 of 12
Anonymous
in reply to: Anonymous

Kirsten,

Have you tried the Customization Help File that ships with LDDT? It contains
a great chart of all the different parts of the interface, with example code
for each part.

Cheers,

Peter Funk
API Product Manager
Building Industry Division
Autodesk, Inc.


"Kirsten" wrote in message
news:1B1A8022F095800595E01427CB598C77@in.WebX.maYIadrTaRb...
> Hi,
> Does anyone know how to call up the "alignment librarian" in your vba
> project?
> TIA,
> -Kirsten
>
>
Message 3 of 12
Anonymous
in reply to: Anonymous

Well, Peter, would that be the "LDD Active X and VBA" link that's under the
contents in the help menu? It says it can't open the file. If you're
talking about the "LDD Users Guide"/Macros, it doesn't cover alignments. If
you're talking about the "LDD Support Assistance"/Customization/VBA, it
basically says to use the help file in Visual Basic.
If you're talking about the help file in "Visual Basic", if you search for
alignment, it gives you a bunch of info on aligning text to the left or
right. If you type AeccAlignment in your code and press F1, you can get
information on the alignments collection, but the closest I come to what I'm
looking for is to get the alignment ID for an object you pick on the screen.
Which will have to do, if I can't find out how to bring up the alignment
librarian.

In summary, yes, I have used the help files. And no, I have found nothing on
the alignment librarian. Have I missed a help file?



"Peter Funk - Autodesk, Inc" wrote in message
news:B17F5BD0BAAD67E1BE5E4911016F4044@in.WebX.maYIadrTaRb...
> Kirsten,
>
> Have you tried the Customization Help File that ships with LDDT? It
contains
> a great chart of all the different parts of the interface, with example
code
> for each part.
>
> Cheers,
>
> Peter Funk
> API Product Manager
> Building Industry Division
> Autodesk, Inc.
>
>
> "Kirsten" wrote in message
> news:1B1A8022F095800595E01427CB598C77@in.WebX.maYIadrTaRb...
> > Hi,
> > Does anyone know how to call up the "alignment librarian" in your vba
> > project?
> > TIA,
> > -Kirsten
> >
> >
>
>
Message 4 of 12
Anonymous
in reply to: Anonymous

Kristen,

Look in the file "Landauto.chm" that should have the information that you
are looking for. As far as the alignment librarian, are you looking for a
way to access the dialogs that exist in the product? If so, they are not
part of the VBA interface, however, it is pretty easy to remake them using
the information that you find in the project.

Cheers,

Peter Funk
API Product Manager
Building Industry Division
Autodesk, Inc.

"Kirsten" wrote in message
news:96489421401054EC932F33042EC0F92C@in.WebX.maYIadrTaRb...
> Well, Peter, would that be the "LDD Active X and VBA" link that's under
the
> contents in the help menu? It says it can't open the file. If you're
> talking about the "LDD Users Guide"/Macros, it doesn't cover alignments.
If
> you're talking about the "LDD Support Assistance"/Customization/VBA, it
> basically says to use the help file in Visual Basic.
> If you're talking about the help file in "Visual Basic", if you search for
> alignment, it gives you a bunch of info on aligning text to the left or
> right. If you type AeccAlignment in your code and press F1, you can get
> information on the alignments collection, but the closest I come to what
I'm
> looking for is to get the alignment ID for an object you pick on the
screen.
> Which will have to do, if I can't find out how to bring up the alignment
> librarian.
>
> In summary, yes, I have used the help files. And no, I have found nothing
on
> the alignment librarian. Have I missed a help file?
>
>
>
> "Peter Funk - Autodesk, Inc" wrote in message
> news:B17F5BD0BAAD67E1BE5E4911016F4044@in.WebX.maYIadrTaRb...
> > Kirsten,
> >
> > Have you tried the Customization Help File that ships with LDDT? It
> contains
> > a great chart of all the different parts of the interface, with example
> code
> > for each part.
> >
> > Cheers,
> >
> > Peter Funk
> > API Product Manager
> > Building Industry Division
> > Autodesk, Inc.
> >
> >
> > "Kirsten" wrote in message
> > news:1B1A8022F095800595E01427CB598C77@in.WebX.maYIadrTaRb...
> > > Hi,
> > > Does anyone know how to call up the "alignment librarian" in your vba
> > > project?
> > > TIA,
> > > -Kirsten
> > >
> > >
> >
> >
>
>
Message 5 of 12
Anonymous
in reply to: Anonymous

Hi Kirsten:

There's no easy answer here. You have a few choices:

1. Use sendcommand (considered somewhat "ugly" by VBA experts):

ThisDrawing.SendCommand "(zz_sdsk '(progn (setq z:n ""e1"")(load2 ""ad""
""setroad"")))" & vbCr & ldd & vbCr

2. Create your own Alignment Librarian. It can be a real simple form with
just a list of alignments. Enclosed is a form that I created to do this
that you can use as a reference. It uses a listview which requires
"Microsoft Windows Common Controls 6.0".

3. Simply send a message to the user to set an alignment current before
using your routine. It's simple for the user to do.

Good luck,

Drew Burgasser
CAD Masters, Inc.


"Kirsten" wrote in message
news:1B1A8022F095800595E01427CB598C77@in.WebX.maYIadrTaRb...
> Hi,
> Does anyone know how to call up the "alignment librarian" in your vba
> project?
> TIA,
> -Kirsten
>
>
Message 6 of 12
Anonymous
in reply to: Anonymous

One more thing regarding creating your own alignment libarian...

Go to the fool's page and check out his "Current Explorer":

http://www.draftingfool.com/lddvba.html

Drew Burgasser
CAD Masters, Inc.

"Drew Burgasser" wrote in message
news:98F4755050648E0BBEE08AF4EBED282E@in.WebX.maYIadrTaRb...
> Hi Kirsten:
>
> There's no easy answer here. You have a few choices:
>
> 1. Use sendcommand (considered somewhat "ugly" by VBA experts):
>
> ThisDrawing.SendCommand "(zz_sdsk '(progn (setq z:n ""e1"")(load2 ""ad""
> ""setroad"")))" & vbCr & ldd & vbCr
>
> 2. Create your own Alignment Librarian. It can be a real simple form
with
> just a list of alignments. Enclosed is a form that I created to do this
> that you can use as a reference. It uses a listview which requires
> "Microsoft Windows Common Controls 6.0".
>
> 3. Simply send a message to the user to set an alignment current before
> using your routine. It's simple for the user to do.
>
> Good luck,
>
> Drew Burgasser
> CAD Masters, Inc.
>
>
> "Kirsten" wrote in message
> news:1B1A8022F095800595E01427CB598C77@in.WebX.maYIadrTaRb...
> > Hi,
> > Does anyone know how to call up the "alignment librarian" in your vba
> > project?
> > TIA,
> > -Kirsten
> >
> >
>
>


----------------------------------------------------------------------------
----


VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} AlignmentLibrarian
Caption = "CMI Tools Alignment Librarian"
ClientHeight = 5988
ClientLeft = 36
ClientTop = 276
ClientWidth = 5760
OleObjectBlob = "AlignmentLibrarian.frx":0000
StartUpPosition = 1 'CenterOwner
End
Attribute VB_Name = "AlignmentLibrarian"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub AlignListView_ColumnClick(ByVal ColumnHeader As ColumnHeader)

If AlignListView.SortOrder = lvwAscending Then
AlignListView.SortOrder = lvwDescending
Else
AlignListView.SortOrder = lvwAscending
End If
AlignListView.SortKey = ColumnHeader.Index - 1
AlignListView.Sorted = True

End Sub

Private Sub CMIEmailPlug_Click()
cmi_cmt_LaunchBrowser "mailto:info@cadmasters.com"
End Sub


Private Sub AlignListView_ItemClick(ByVal Item As ListItem)

Dim i As Integer, x As Integer, als As AeccAlignments
Set als = AeccApplication.ActiveProject.Alignments

For i = 0 To als.Count - 1
If Item.Text = als.Item(i).Number Then
NameValue = als.Item(i).Name
NumberValue = als.Item(i).Number
DescriptionValue = als.Item(i).Description
StartStationValue =
als.DoubleToStaFormat(als.Item(i).StartingStation)
EndStationValue = als.DoubleToStaFormat(als.Item(i).EndingStation)
Exit For
End If
Next

End Sub

Private Sub CancelButton_Click()
ThisDrawing.Utility.Prompt vbCrLf & "*Cancel*" & vbCrLf
Me.CancelButton.Tag = "yes"
Me.hide
End Sub

Private Sub OkayButton_Click()
AlignmentLibrarian.hide
End Sub

Private Sub CMIWebPlug_Click()
cmi_cmt_LaunchBrowser "www.cadmasters.com"
End Sub

Private Sub UserForm_Initialize()

Dim i As Integer, x As ListItem, als As AeccAlignments
Set als = AeccApplication.ActiveProject.Alignments

For i = 0 To als.Count - 1
Set x = AlignListView.ListItems.Add()
x.Text = als.Item(i).Number
x.SubItems(1) = als.Item(i).Name
x.SubItems(2) = als.Item(i).Description
Next

Set AlignListView.SelectedItem = AlignListView.ListItems(1)

End Sub
Message 7 of 12
Anonymous
in reply to: Anonymous

OK Peter, I found the landauto file. Thanks. I'll read through it soon.
In the meantime, the dvb file from the Drafting Fool seems to satisfy my
needs. Thanks for pointing me there, Drew. I'll delve into your "alignment
librarian". It seems I've got more than enough information here. Thanks
everyone!


"Drew Burgasser" wrote in message
news:32394B6E216B99B91329F68BF916BBBA@in.WebX.maYIadrTaRb...
> One more thing regarding creating your own alignment libarian...
>
> Go to the fool's page and check out his "Current Explorer":
>
> http://www.draftingfool.com/lddvba.html
>
> Drew Burgasser
> CAD Masters, Inc.
>
> "Drew Burgasser" wrote in message
> news:98F4755050648E0BBEE08AF4EBED282E@in.WebX.maYIadrTaRb...
> > Hi Kirsten:
> >
> > There's no easy answer here. You have a few choices:
> >
> > 1. Use sendcommand (considered somewhat "ugly" by VBA experts):
> >
> > ThisDrawing.SendCommand "(zz_sdsk '(progn (setq z:n ""e1"")(load2 ""ad""
> > ""setroad"")))" & vbCr & ldd & vbCr
> >
> > 2. Create your own Alignment Librarian. It can be a real simple form
> with
> > just a list of alignments. Enclosed is a form that I created to do this
> > that you can use as a reference. It uses a listview which requires
> > "Microsoft Windows Common Controls 6.0".
> >
> > 3. Simply send a message to the user to set an alignment current before
> > using your routine. It's simple for the user to do.
> >
> > Good luck,
> >
> > Drew Burgasser
> > CAD Masters, Inc.
> >
> >
> > "Kirsten" wrote in message
> > news:1B1A8022F095800595E01427CB598C77@in.WebX.maYIadrTaRb...
> > > Hi,
> > > Does anyone know how to call up the "alignment librarian" in your vba
> > > project?
> > > TIA,
> > > -Kirsten
> > >
> > >
> >
> >
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> VERSION 5.00
> Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} AlignmentLibrarian
> Caption = "CMI Tools Alignment Librarian"
> ClientHeight = 5988
> ClientLeft = 36
> ClientTop = 276
> ClientWidth = 5760
> OleObjectBlob = "AlignmentLibrarian.frx":0000
> StartUpPosition = 1 'CenterOwner
> End
> Attribute VB_Name = "AlignmentLibrarian"
> Attribute VB_GlobalNameSpace = False
> Attribute VB_Creatable = False
> Attribute VB_PredeclaredId = True
> Attribute VB_Exposed = False
>
> Private Sub AlignListView_ColumnClick(ByVal ColumnHeader As ColumnHeader)
>
> If AlignListView.SortOrder = lvwAscending Then
> AlignListView.SortOrder = lvwDescending
> Else
> AlignListView.SortOrder = lvwAscending
> End If
> AlignListView.SortKey = ColumnHeader.Index - 1
> AlignListView.Sorted = True
>
> End Sub
>
> Private Sub CMIEmailPlug_Click()
> cmi_cmt_LaunchBrowser "mailto:info@cadmasters.com"
> End Sub
>
>
> Private Sub AlignListView_ItemClick(ByVal Item As ListItem)
>
> Dim i As Integer, x As Integer, als As AeccAlignments
> Set als = AeccApplication.ActiveProject.Alignments
>
> For i = 0 To als.Count - 1
> If Item.Text = als.Item(i).Number Then
> NameValue = als.Item(i).Name
> NumberValue = als.Item(i).Number
> DescriptionValue = als.Item(i).Description
> StartStationValue =
> als.DoubleToStaFormat(als.Item(i).StartingStation)
> EndStationValue = als.DoubleToStaFormat(als.Item(i).EndingStation)
> Exit For
> End If
> Next
>
> End Sub
>
> Private Sub CancelButton_Click()
> ThisDrawing.Utility.Prompt vbCrLf & "*Cancel*" & vbCrLf
> Me.CancelButton.Tag = "yes"
> Me.hide
> End Sub
>
> Private Sub OkayButton_Click()
> AlignmentLibrarian.hide
> End Sub
>
> Private Sub CMIWebPlug_Click()
> cmi_cmt_LaunchBrowser "www.cadmasters.com"
> End Sub
>
> Private Sub UserForm_Initialize()
>
> Dim i As Integer, x As ListItem, als As AeccAlignments
> Set als = AeccApplication.ActiveProject.Alignments
>
> For i = 0 To als.Count - 1
> Set x = AlignListView.ListItems.Add()
> x.Text = als.Item(i).Number
> x.SubItems(1) = als.Item(i).Name
> x.SubItems(2) = als.Item(i).Description
> Next
>
> Set AlignListView.SelectedItem = AlignListView.ListItems(1)
>
> End Sub
>
>
>
>
Message 8 of 12
Anonymous
in reply to: Anonymous

> In the meantime, the dvb file from the
> Drafting Fool seems to satisfy my needs.

:-) WhoooHooo Glad to help
_______________________________
David Gregori, Draftingfool.com
Message 9 of 12
Anonymous
in reply to: Anonymous

I also need an "Alignment Librarian Method"

Although your method No.1 "sendcommand" is frowned on by programmers it seems to be best interim solution until Autodesk creates a method for the Alignment Librarian.

It may be easy to create a list box allowing, the user to select an alignment. However, the advantage to using the Alignment Librarian is that the user can also select an alignment object on the screen. I guess I could also program this by examining the Xdata of the alignment object, but again why go to all the trouble when hopefully Autodesk creates a Method for this.

Anyway Drew, the sample sendcommand works great in VB6.0. However, in VBA it triggers AutoCAD’s macro dialog box and not the Alignment Librarian.

Any Ideas why ????

And using the following.
ThisDrawing.SendCommand ("(load2 ""ad"" ""setroad"") ")
Does not wait for the user to select an alignment. The Alignment Librarian is triggered after my program is terminated.
Message 10 of 12
Anonymous
in reply to: Anonymous

Try this:

ThisDrawing.SendCommand "(zz_sdsk '(progn (setq z:n ""e1"")(load2 ""ad""
""setroad"")))" & vbCr & "ldd" & vbCr

Notice the quotes around ldd.

Good luck,

Drew Burgasser
CAD Masters, Inc.

"Mal" wrote in message
news:f088c17.7@WebX.maYIadrTaRb...
I also need an "Alignment Librarian Method"
Although your method No.1 "sendcommand" is frowned on by programmers it
seems to be best interim solution until Autodesk creates a method for the
Alignment Librarian.
It may be easy to create a list box allowing, the user to select an
alignment. However, the advantage to using the Alignment Librarian is that
the user can also select an alignment object on the screen. I guess I could
also program this by examining the Xdata of the alignment object, but again
why go to all the trouble when hopefully Autodesk creates a Method for this.
Anyway Drew, the sample sendcommand works great in VB6.0. However, in VBA it
triggers AutoCAD's macro dialog box and not the Alignment Librarian.
Any Ideas why ????
And using the following.
ThisDrawing.SendCommand ("(load2 ""ad"" ""setroad"") ")
Does not wait for the user to select an alignment. The Alignment Librarian
is triggered after my program is terminated.
Message 11 of 12
Anonymous
in reply to: Anonymous

Thanks Drew
It works..... well somewhat.

Although I now have a prompt for an alignment at the command line.
The next VBA line of code is excuted without waiting for me to select an alignment.
e.g.
count is set to 0 before the user selects an alignment.

ThisDrawing.SendCommand "(zz_sdsk '(progn (setq z:n ""e1"")(load2 ""ad"" ""setroad"")))" & vbCr & "ldd" & vbCr
count = 0
algName = proj.Alignments.CurrentAlignment
Message 12 of 12
Anonymous
in reply to: Anonymous

Hence, one of the problems with SendCommand.

Take a look at the following site:

http://vbdesign.hypermart.net/cadpages/tbox.htm

Scroll down and check out "Send synchronous Command".

Good luck,

Drew Burgasser
CAD Masters, Inc.




"Mal" wrote in message
news:f088c17.9@WebX.maYIadrTaRb...
Thanks Drew
It works..... well somewhat.
Although I now have a prompt for an alignment at the command line.
The next VBA line of code is excuted without waiting for me to select an
alignment.
e.g.
count is set to 0 before the user selects an alignment.
ThisDrawing.SendCommand "(zz_sdsk '(progn (setq z:n ""e1"")(load2 ""ad""
""setroad"")))" & vbCr & "ldd" & vbCr
count = 0
algName = proj.Alignments.CurrentAlignment

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

Post to forums  

Autodesk Design & Make Report