Home All Groups Group Topic Archive Search About
Author
23 Sep 2005 6:28 PM
tractng
Guys,

I am new to API programming.  I am trying to write the information of a
property page of a file to another file.

For instance, the property page of a file has the information already
filled in by the user within a program that they used.  I want to copy
some of the fields to another file (property page).

The software we are using is Inventor (similar to AutoCAD).  From what
I understood, the software is making the APIs available for use, but I
don't know how to access it.

Do I have to write the codes to access the API's (to get it to list
the API) or can I use the object browser in Visual Basic.  It seems
that the API listed are not that much if I use the object browser in
Visual Basic.  I am reading that the APIs are made available.  Any help
would be appreciated.

Do I take the approach of writing it within the program or outside of
it?  You can see the details of the  property page through windows
explorer by right clicking it.

Btw, the Inventor software has a Visual Basic Editor and Macros built
inside.


Thanks,
Tony

Author
23 Sep 2005 9:56 PM
BeastFish
I'm guessing you are referring to API functions of the vendor's DLLs.
You'll need to know the functions and how they're declared and used.  I
suggest contacting the vendor or pouring through any documentation they
provided.


<trac***@gmail.com> wrote in message
Show quoteHide quote
news:1127500111.996236.117660@g14g2000cwa.googlegroups.com...
> Guys,
>
> I am new to API programming.  I am trying to write the information of a
> property page of a file to another file.
>
> For instance, the property page of a file has the information already
> filled in by the user within a program that they used.  I want to copy
> some of the fields to another file (property page).
>
> The software we are using is Inventor (similar to AutoCAD).  From what
> I understood, the software is making the APIs available for use, but I
> don't know how to access it.
>
> Do I have to write the codes to access the API's (to get it to list
> the API) or can I use the object browser in Visual Basic.  It seems
> that the API listed are not that much if I use the object browser in
> Visual Basic.  I am reading that the APIs are made available.  Any help
> would be appreciated.
>
> Do I take the approach of writing it within the program or outside of
> it?  You can see the details of the  property page through windows
> explorer by right clicking it.
>
> Btw, the Inventor software has a Visual Basic Editor and Macros built
> inside.
>
>
> Thanks,
> Tony
>
Author
23 Sep 2005 9:59 PM
Veign
I have some code samples showing the use of the API's from Mechanical
Desktop (might be one Inventor code sample too).  Use this as a guide..

Link:
http://www.veign.com/vrc_app_cat.asp?catid=7

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


<trac***@gmail.com> wrote in message
Show quoteHide quote
news:1127500111.996236.117660@g14g2000cwa.googlegroups.com...
> Guys,
>
> I am new to API programming.  I am trying to write the information of a
> property page of a file to another file.
>
> For instance, the property page of a file has the information already
> filled in by the user within a program that they used.  I want to copy
> some of the fields to another file (property page).
>
> The software we are using is Inventor (similar to AutoCAD).  From what
> I understood, the software is making the APIs available for use, but I
> don't know how to access it.
>
> Do I have to write the codes to access the API's (to get it to list
> the API) or can I use the object browser in Visual Basic.  It seems
> that the API listed are not that much if I use the object browser in
> Visual Basic.  I am reading that the APIs are made available.  Any help
> would be appreciated.
>
> Do I take the approach of writing it within the program or outside of
> it?  You can see the details of the  property page through windows
> explorer by right clicking it.
>
> Btw, the Inventor software has a Visual Basic Editor and Macros built
> inside.
>
>
> Thanks,
> Tony
>
Author
23 Sep 2005 11:46 PM
tractng
Thanks a lot.


Tony
Author
26 Sep 2005 7:20 PM
tractng
Guys,

Below is my current code.  The code writes a value to a field in the
current active document.

Instead of writing the value to the current field (assuming the field
value is there already), how can I make it read that field's value
from the active document and write the value to a file that is not
currently active (sitting in the background within the program which is
located in c:\temp).  Btw, the API unique name is the same on both
pages.


Public Sub Test3()
' Declare the Application object
Dim oApplication As Inventor.Application

' Obtain the Inventor Application object.
' This assumes Inventor is already running.
Set oApplication = GetObject(, "Inventor.Application")

' Set a reference to the active document.
' This assumes a document is open.
Dim oDoc As Document
Set oDoc = oApplication.ActiveDocument

' Obtain the PropertySets collection object
Dim oPropsets As PropertySets
Set oPropsets = oDoc.PropertySets


' Get a reference to the "Date Checked" property.
Dim oProp As Property
Dim PartNum As String

Set oProp =
oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kStockNumberDesignTrackingProperties)

' Define a Date variable with the desired date.

PartNum = "9836-scoobie1"

' Assign the date to the property.
oProp.Value = PartNum

End Sub

Thanks in advance,
Tony
Author
26 Sep 2005 7:35 PM
Veign
No idea (and most would not in this newsgroup)...Try one of the many
Autodesk newsgroups

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


<trac***@gmail.com> wrote in message
Show quoteHide quote
news:1127762449.769413.182900@o13g2000cwo.googlegroups.com...
> Guys,
>
> Below is my current code.  The code writes a value to a field in the
> current active document.
>
> Instead of writing the value to the current field (assuming the field
> value is there already), how can I make it read that field's value
> from the active document and write the value to a file that is not
> currently active (sitting in the background within the program which is
> located in c:\temp).  Btw, the API unique name is the same on both
> pages.
>
>
> Public Sub Test3()
> ' Declare the Application object
> Dim oApplication As Inventor.Application
>
> ' Obtain the Inventor Application object.
> ' This assumes Inventor is already running.
> Set oApplication = GetObject(, "Inventor.Application")
>
> ' Set a reference to the active document.
> ' This assumes a document is open.
> Dim oDoc As Document
> Set oDoc = oApplication.ActiveDocument
>
> ' Obtain the PropertySets collection object
> Dim oPropsets As PropertySets
> Set oPropsets = oDoc.PropertySets
>
>
> ' Get a reference to the "Date Checked" property.
> Dim oProp As Property
> Dim PartNum As String
>
> Set oProp =
>
oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kStock
NumberDesignTrackingProperties)
Show quoteHide quote
>
> ' Define a Date variable with the desired date.
>
> PartNum = "9836-scoobie1"
>
> ' Assign the date to the property.
> oProp.Value = PartNum
>
> End Sub
>
> Thanks in advance,
> Tony
>
Author
27 Sep 2005 5:26 AM
tractng
Chris,

I am just trying to find sample codes that read the value.  I already
have the
codes on how to write to the field.

Its been a while I wrote VB(A), but i guess I have to use the Until
Loop to go the API.

Thanks,
Tony
Veign wrote:
Show quoteHide quote
> No idea (and most would not in this newsgroup)...Try one of the many
> Autodesk newsgroups
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> Veign's Blog
> http://www.veign.com/blog
> --
>
>
> <trac***@gmail.com> wrote in message
> news:1127762449.769413.182900@o13g2000cwo.googlegroups.com...
> > Guys,
> >
> > Below is my current code.  The code writes a value to a field in the
> > current active document.
> >
> > Instead of writing the value to the current field (assuming the field
> > value is there already), how can I make it read that field's value
> > from the active document and write the value to a file that is not
> > currently active (sitting in the background within the program which is
> > located in c:\temp).  Btw, the API unique name is the same on both
> > pages.
> >
> >
> > Public Sub Test3()
> > ' Declare the Application object
> > Dim oApplication As Inventor.Application
> >
> > ' Obtain the Inventor Application object.
> > ' This assumes Inventor is already running.
> > Set oApplication = GetObject(, "Inventor.Application")
> >
> > ' Set a reference to the active document.
> > ' This assumes a document is open.
> > Dim oDoc As Document
> > Set oDoc = oApplication.ActiveDocument
> >
> > ' Obtain the PropertySets collection object
> > Dim oPropsets As PropertySets
> > Set oPropsets = oDoc.PropertySets
> >
> >
> > ' Get a reference to the "Date Checked" property.
> > Dim oProp As Property
> > Dim PartNum As String
> >
> > Set oProp =
> >
> oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kStock
> NumberDesignTrackingProperties)
> >
> > ' Define a Date variable with the desired date.
> >
> > PartNum = "9836-scoobie1"
> >
> > ' Assign the date to the property.
> > oProp.Value = PartNum
> >
> > End Sub
> >
> > Thanks in advance,
> > Tony
> >
Author
27 Sep 2005 4:07 PM
Veign
Just because you are writing code in VB(A) doesn't mean the code is native
VB(A) code.  The applications that host VBA create their own libraries and
expose methods, properties, and events that are specific to the host
application.  This is why you should be asking in a newsgroup geared towards
the host application and not VB(A)...

If you don't want to take my advice, that's fine.  Keep waiting here for an
answer....
(4th time I have responded to one of your API questions)

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


<trac***@gmail.com> wrote in message
Show quoteHide quote
news:1127798780.601641.253250@g43g2000cwa.googlegroups.com...
> Chris,
>
> I am just trying to find sample codes that read the value.  I already
> have the
> codes on how to write to the field.
>
> Its been a while I wrote VB(A), but i guess I have to use the Until
> Loop to go the API.
>
> Thanks,
> Tony
> Veign wrote:
> > No idea (and most would not in this newsgroup)...Try one of the many
> > Autodesk newsgroups
> >
> > --
> > Chris Hanscom - Microsoft MVP (VB)
> > Veign's Resource Center
> > http://www.veign.com/vrc_main.asp
> > Veign's Blog
> > http://www.veign.com/blog
> > --
> >
> >
> > <trac***@gmail.com> wrote in message
> > news:1127762449.769413.182900@o13g2000cwo.googlegroups.com...
> > > Guys,
> > >
> > > Below is my current code.  The code writes a value to a field in the
> > > current active document.
> > >
> > > Instead of writing the value to the current field (assuming the field
> > > value is there already), how can I make it read that field's value
> > > from the active document and write the value to a file that is not
> > > currently active (sitting in the background within the program which
is
> > > located in c:\temp).  Btw, the API unique name is the same on both
> > > pages.
> > >
> > >
> > > Public Sub Test3()
> > > ' Declare the Application object
> > > Dim oApplication As Inventor.Application
> > >
> > > ' Obtain the Inventor Application object.
> > > ' This assumes Inventor is already running.
> > > Set oApplication = GetObject(, "Inventor.Application")
> > >
> > > ' Set a reference to the active document.
> > > ' This assumes a document is open.
> > > Dim oDoc As Document
> > > Set oDoc = oApplication.ActiveDocument
> > >
> > > ' Obtain the PropertySets collection object
> > > Dim oPropsets As PropertySets
> > > Set oPropsets = oDoc.PropertySets
> > >
> > >
> > > ' Get a reference to the "Date Checked" property.
> > > Dim oProp As Property
> > > Dim PartNum As String
> > >
> > > Set oProp =
> > >
> >
oPropsets.Item("{32853F0F-3444-11d1-9E93-0060B03C1CA6}").ItemByPropId(kStock
Show quoteHide quote
> > NumberDesignTrackingProperties)
> > >
> > > ' Define a Date variable with the desired date.
> > >
> > > PartNum = "9836-scoobie1"
> > >
> > > ' Assign the date to the property.
> > > oProp.Value = PartNum
> > >
> > > End Sub
> > >
> > > Thanks in advance,
> > > Tony
> > >
>
Author
27 Sep 2005 4:19 PM
MP
Tony,
fwiw there are 6 or 7 inventor groups on the adesk server.
Chris is trying to get you to realize that's where you will have better luck
They all start with autodesk.inventor
hth
Mark

Show quoteHide quote
"Veign" <NOSPAMinveign@veign.com> wrote in message
news:%23k8mb43wFHA.2728@TK2MSFTNGP14.phx.gbl...
> Just because you are writing code in VB(A) doesn't mean the code is native
> VB(A) code.  The applications that host VBA create their own libraries and
> expose methods, properties, and events that are specific to the host
> application.  This is why you should be asking in a newsgroup geared
towards
> the host application and not VB(A)...
>
> If you don't want to take my advice, that's fine.  Keep waiting here for
an
> answer....
> (4th time I have responded to one of your API questions)
>
> --
> Chris Hanscom - Microsoft MVP (VB)
> Veign's Resource Center
> http://www.veign.com/vrc_main.asp
> Veign's Blog
>
Author
27 Sep 2005 7:28 PM
tractng
Guys,

I think I got the codes.  I am storing the data that is from the active
file.  How do I call a non-active file that is in the background
(already opened) and it make it active.?


Thanks,
Tony
Author
27 Sep 2005 7:52 PM
Veign
You really don't like to listen do you....

Too bad....

--
Chris Hanscom - Microsoft MVP (VB)
Veign's Resource Center
http://www.veign.com/vrc_main.asp
Veign's Blog
http://www.veign.com/blog
--


<trac***@gmail.com> wrote in message
Show quoteHide quote
news:1127849332.328803.246170@g47g2000cwa.googlegroups.com...
> Guys,
>
> I think I got the codes.  I am storing the data that is from the active
> file.  How do I call a non-active file that is in the background
> (already opened) and it make it active.?
>
>
> Thanks,
> Tony
>