VBA for Inventor Books

VBA for Inventor Books

YvesGingras
Contributor Contributor
858 Views
18 Replies
Message 1 of 19

VBA for Inventor Books

YvesGingras
Contributor
Contributor
Hi!

Could anyone suggest me a good book about using VBA with the Inventor Object Model.

I have appreciated M. Sutphin's book on AutoCad 2000 VBA, but I am afraid there is none of this kind concerning Inventor.
Your suggestions will be greatly appreciated.

Thanks in advance.

Ging
0 Likes
859 Views
18 Replies
Replies (18)
Message 2 of 19

Anonymous
Not applicable
Never seen any books myself. Try this site
http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112

Of note are the zipped documents. Exspecially nice is the DWF of the Inventor Object Model. Plot it out and hang it on your wall for reference.

Another resource I did not see right away at first was the overviews section in API help.

What area of the Inventor API did you want to get into?

Regards,
0 Likes
Message 3 of 19

Anonymous
Not applicable
Just so you know this site is in the process of being updated with Inventor
11 content, including the object model chart. The new content should be
available in the next few days. The easy to remember name of the site is
www.autodeskcom/developinventor

I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve. Specific items will be the most useful.
For example, saying that you want more samples doesn't help very much but
saying that you would like more samples that demonstrate assembly
constraints (for example) will help. This helps in understanding particular
areas of the API that might be more difficult to understand and where we
need to focus efforts in writing more documentation and samples. Besides
samples, any comments on documentation are also very welcome.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5205217@discussion.autodesk.com...
Never seen any books myself. Try this site
http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112

Of note are the zipped documents. Exspecially nice is the DWF of the
Inventor Object Model. Plot it out and hang it on your wall for reference.

Another resource I did not see right away at first was the overviews section
in API help.

What area of the Inventor API did you want to get into?

Regards,
0 Likes
Message 4 of 19

Anonymous
Not applicable
Brian,

With more users coming across from Acad - where you didn't even need to know AutoLisp to be able to program it - Adsk will seriously
have to think about a book from "Hello World" onwards.

A lot of Acad users - myself included - could get by with a basic understanding of ASCII, English and pen-up & pen-down etc. You
didn't need to know AutoLisp to create a Script file, compound functions (such as ^C^C_copy \ \ _rotate p \ -90 ), specialist
functions (such as Stretch with Crossing Polygon) and even the first or basic level of AutoLisp where the code was used to silently
send commands to the command line - as opposed creating the full paired list and then displaying it.

Now these users are moving across to Inv they want to do little bits of automation etc, but haven't the confidence to tackle VB(A).
Personally I would like to write little VBA routines to help automate some of my tasks, but I'm not going to do it in a production -
work - environment until I feel confident. I'm trying to find time to sit down at home. but I'm put off by the fact that there isn't
a single book that shows users the basics of VBA in Inv.

This is something ADSK must get to grips with. It is well known that the Help DSS documentation is back to appalling in Inv, but the
lack of a book for VBA and porting to VB (and even sections on VC++ VC# dotNet etc) is tant-amount to criminal.

There must be somebody is ADSK technical writing dept. that can start writing a book on VBA in Inv. Look at the books that came out
with Acad12, after reading them you had the confidence to attempt a lot of the customising and simple programming in Acad.


The book is need to aid with confidence.



--
Duncan
"Humour ... is one man shouting gibberish in the face of authority, and proving by fabricated insanity that nothing could be as mad
as what passes for ordinary living."
(Terence 'Spike' Milligan K.B.E., 1918-2002)
www.autodesk.co.uk/inventorjobs




"Brian Ekins (Autodesk)" wrote in message news:5206740@discussion.autodesk.com...
Just so you know this site is in the process of being updated with Inventor
11 content, including the object model chart. The new content should be
available in the next few days. The easy to remember name of the site is
www.autodeskcom/developinventor

I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve. Specific items will be the most useful.
For example, saying that you want more samples doesn't help very much but
saying that you would like more samples that demonstrate assembly
constraints (for example) will help. This helps in understanding particular
areas of the API that might be more difficult to understand and where we
need to focus efforts in writing more documentation and samples. Besides
samples, any comments on documentation are also very welcome.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5205217@discussion.autodesk.com...
Never seen any books myself. Try this site
http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112

Of note are the zipped documents. Exspecially nice is the DWF of the
Inventor Object Model. Plot it out and hang it on your wall for reference.

Another resource I did not see right away at first was the overviews section
in API help.

What area of the Inventor API did you want to get into?

Regards,
0 Likes
Message 5 of 19

Anonymous
Not applicable
Just give us the same ammount of VB examples as with AutoCAD 🙂

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP3a
--
0 Likes
Message 6 of 19

Anonymous
Not applicable
I'm holding out for the book ... and the pigeon pie 😉


--
Duncan
"Humour ... is one man shouting gibberish in the face of authority, and proving by fabricated insanity that nothing could be as mad
as what passes for ordinary living."
(Terence 'Spike' Milligan K.B.E., 1918-2002)
www.autodesk.co.uk/inventorjobs



"Teun Ham (IV9 SP4 / IV10 SP3a)" wrote in message
news:5208728@discussion.autodesk.com...
Just give us the same ammount of VB examples as with AutoCAD 🙂

--
T. Ham
Mechanical Engineer
CDS Engineering BV

Dual Pentium XEON 2.2 Ghz
2 GB SDRAM
NVIDIA QUADRO4 700 XGL (Driver = 77.18)
18 GB SEAGATE SCSI Hard Disc
3Com Gigabit NIC

Windows 2000 Professional SP4
Autodesk Inventor Series 9 SP4
Autodesk Inventor Series 10 SP3a
--
0 Likes
Message 7 of 19

Anonymous
Not applicable
I agree with what has been posted. You can't just do specific parts of it
and call it good. Every object, method, and property should have a short
example code with it. That seems to be pretty standard in many coding help
files, and really helps peoples learning curve.

As for things that need extra attention, I have always found matrix's
confusing. I am not sure they could be explained to the point that I
wouldn't still find them confusing, ;~) but it would be nice to see more
info on them. Even with the examples, I found client graphics a little
difficult to understand and work with. I am sure there is more, but that is
what I can think of right off the top.

--
___________________
Kent Keller
www.kwikmcad.com
"Brian Ekins (Autodesk)" wrote in message


I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve.
0 Likes
Message 8 of 19

Anonymous
Not applicable
Thanks for the input and I agree with you Kent that the documentation
utlimately needs to provided clear explanations along with sample code for
everything. However, we'll have to there a piece at a time so having the
information like you provided is useful to help in prioritizing what we work
on first.

Any others have particular areas that you've struggled with?
--
Brian Ekins
Autodesk Inventor API

"Kent Keller" wrote in message
news:5209041@discussion.autodesk.com...
I agree with what has been posted. You can't just do specific parts of it
and call it good. Every object, method, and property should have a short
example code with it. That seems to be pretty standard in many coding help
files, and really helps peoples learning curve.

As for things that need extra attention, I have always found matrix's
confusing. I am not sure they could be explained to the point that I
wouldn't still find them confusing, ;~) but it would be nice to see more
info on them. Even with the examples, I found client graphics a little
difficult to understand and work with. I am sure there is more, but that is
what I can think of right off the top.

--
___________________
Kent Keller
www.kwikmcad.com
"Brian Ekins (Autodesk)" wrote in message


I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve.
0 Likes
Message 9 of 19

Anonymous
Not applicable
For a beginner (And for the rest of us.) I think that a more generalized overview of the API at a 500 feet would be beneficial.

For example. I still do not know how the DataIO object was intended to be used.

Same with Attibutes. How would a third party database link with them. (Help mentions it can but not much else.)

A detailed Inventor 'Project file' features overview

An 'Accessed by' link (Accessors) in each help screen would be good too. It pretty frustating to find an interesting method and not be able to quickly see where you instantiate it from.

The last issue is the assumption that the API User has an in depth knowlege of the finer points of using Inventor. (Definitely not true in my case.)
0 Likes
Message 10 of 19

YvesGingras
Contributor
Contributor
Thanks Tom for your reply, and to all the participants for this constructive discussion.

I already had found the ObjectModel, and it is printed in color, and posted on a wall nearby at the office. 😉 I am trying to use most of what is available from Autodesk.

Presently I am working (at home for now) on a little project the will let the user set the driving parameters of small assembly, through a dialog box that pops when a ipt file, used to hold those parameters and linked to the parts of the assembly, is opened.

So far things are going well but I still did not resolve the difficulty I am facing to initialize the form and reed the parameter expressions (in order to post them in the txtBoxes), while the file is opening (this runs in AutoNew Sub).

So I have tried to loop with a timer with the “DoEvent” function until “ Not the Document Is Nothing”, but it is stalling in the loop even though it is checking (every five seconds) for the document status.

What I am exploring now, and winch is completely unfamiliar to me is an Event at the Document level. Something like “Open – After” (I don’t think it exists for Inventor) that would trigger the “Form.Show” only once the ipt


Regards

Yves Gingras
0 Likes
Message 11 of 19

YvesGingras
Contributor
Contributor
I am sorry, there is a couple mistakes in my post the makes the message difficult to understand.

First, it is a AutoOPEN sub.

Second, the end of the last sentence is "...that would trigger the “Form.Show” only once the ipt is fully opened.

Sorry agan.
0 Likes
Message 12 of 19

Anonymous
Not applicable
As far as the API help goes, I be interested in seeing:
-More "useful" samples of code for all the properties, functions, and methods. Useful meaning real world examples. Stuff that I would actually use in day to day programming/design.
-I found the setup ot the help to be a bit confusing at first. Not having the overviews linked directly from the "main" help for a specific function/method was particularly odd.

As far as the API itself goes...
-Built in metric<->Imperial conversion functions/subs. e.g. Something like "GetValueFromExpressionImp" where I ask for a length in inches and it actually returns a value in inches, rather than cm. Right now GetValueFromExpression returns a value in "database units" that I then have to convert, and since I don't know the exact conversion factors that Inventor uses, I typically lose precision doing so.

Maybe it's just me but I find the names of these functions misleading and confusting. I'd originally thought I was providing a units parameter to tell it what I wanted the value returned as, not to tell the function what the first parameter's units were.

-I'd also like the values returned to be the entire value, not a rounded off value controlled by my drawing's current precision. When I want to show a value on a form, or something else, let me format it to what I'd like to show, but at least I can use the entire number during calculations without worrying about precision lose or why 2.54cm *.3937???? = 0.9999 in instead of 1.00 in. At the miniumum provide constants for conversion factors, e.g. kCmToInch = 0.393700787 (or does it?)

All in all, this forum is a great place to point people for help.
0 Likes
Message 13 of 19

Anonymous
Not applicable
No Worries Ging,

I've built a parameter organizer / editor that has become part of our standard engineering process. I can give you a couple of hints.

1) Create the application as an add_in.
2) Utilize the OnOpenDocument() Event to retreive inventor file parameters.

If you want to take this conversation off line my email is tgroff@pacificstainless.com

Cheers,
0 Likes
Message 14 of 19

Anonymous
Not applicable
Brian,
When it will be available??
I tried to this link and nothing there yet???
Thx, Chris

"Brian Ekins (Autodesk)" wrote in message
news:5206740@discussion.autodesk.com...
Just so you know this site is in the process of being updated with Inventor
11 content, including the object model chart. The new content should be
available in the next few days. The easy to remember name of the site is
www.autodeskcom/developinventor

I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve. Specific items will be the most useful.
For example, saying that you want more samples doesn't help very much but
saying that you would like more samples that demonstrate assembly
constraints (for example) will help. This helps in understanding particular
areas of the API that might be more difficult to understand and where we
need to focus efforts in writing more documentation and samples. Besides
samples, any comments on documentation are also very welcome.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5205217@discussion.autodesk.com...
Never seen any books myself. Try this site
http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112

Of note are the zipped documents. Exspecially nice is the DWF of the
Inventor Object Model. Plot it out and hang it on your wall for reference.

Another resource I did not see right away at first was the overviews section
in API help.

What area of the Inventor API did you want to get into?

Regards,
0 Likes
Message 15 of 19

Anonymous
Not applicable
< inches and it actually returns a value in inches, rather than cm.>>

I believe what you are looking for is the UnitsOfMeasure.ConvertUnits
method. The 3rd argument in the method specifies which units to return the
values in. The help document has detailed explanations on the arguments.

Sanjay-


wrote in message news:5210653@discussion.autodesk.com...
As far as the API help goes, I be interested in seeing:
-More "useful" samples of code for all the properties, functions, and
methods. Useful meaning real world examples. Stuff that I would actually use
in day to day programming/design.
-I found the setup ot the help to be a bit confusing at first. Not having
the overviews linked directly from the "main" help for a specific
function/method was particularly odd.

As far as the API itself goes...
-Built in metric<->Imperial conversion functions/subs. e.g. Something like
"GetValueFromExpressionImp" where I ask for a length in inches and it
actually returns a value in inches, rather than cm. Right now
GetValueFromExpression returns a value in "database units" that I then have
to convert, and since I don't know the exact conversion factors that
Inventor uses, I typically lose precision doing so.

Maybe it's just me but I find the names of these functions misleading and
confusting. I'd originally thought I was providing a units parameter to tell
it what I wanted the value returned as, not to tell the function what the
first parameter's units were.

-I'd also like the values returned to be the entire value, not a rounded off
value controlled by my drawing's current precision. When I want to show a
value on a form, or something else, let me format it to what I'd like to
show, but at least I can use the entire number during calculations without
worrying about precision lose or why 2.54cm *.3937???? = 0.9999 in instead
of 1.00 in. At the miniumum provide constants for conversion factors, e.g.
kCmToInch = 0.393700787 (or does it?)

All in all, this forum is a great place to point people for help.
0 Likes
Message 16 of 19

Anonymous
Not applicable
It's there now.
--
Brian Ekins
Autodesk Inventor API

"Chris (IV11 Pro. SP1 - uninstalled)" wrote in message
news:5211523@discussion.autodesk.com...
Brian,
When it will be available??
I tried to this link and nothing there yet???
Thx, Chris

"Brian Ekins (Autodesk)" wrote in message
news:5206740@discussion.autodesk.com...
Just so you know this site is in the process of being updated with Inventor
11 content, including the object model chart. The new content should be
available in the next few days. The easy to remember name of the site is
www.autodeskcom/developinventor

I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve. Specific items will be the most useful.
For example, saying that you want more samples doesn't help very much but
saying that you would like more samples that demonstrate assembly
constraints (for example) will help. This helps in understanding particular
areas of the API that might be more difficult to understand and where we
need to focus efforts in writing more documentation and samples. Besides
samples, any comments on documentation are also very welcome.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5205217@discussion.autodesk.com...
Never seen any books myself. Try this site
http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112

Of note are the zipped documents. Exspecially nice is the DWF of the
Inventor Object Model. Plot it out and hang it on your wall for reference.

Another resource I did not see right away at first was the overviews section
in API help.

What area of the Inventor API did you want to get into?

Regards,
0 Likes
Message 17 of 19

Anonymous
Not applicable
Brian,
Has anyone reported to have trouble to get access there.
I tried few times, but couldn't
Thx, Chris

"Brian Ekins (Autodesk)" wrote in message
news:5212363@discussion.autodesk.com...
It's there now.
--
Brian Ekins
Autodesk Inventor API

"Chris (IV11 Pro. SP1 - uninstalled)" wrote in message
news:5211523@discussion.autodesk.com...
Brian,
When it will be available??
I tried to this link and nothing there yet???
Thx, Chris

"Brian Ekins (Autodesk)" wrote in message
news:5206740@discussion.autodesk.com...
Just so you know this site is in the process of being updated with Inventor
11 content, including the object model chart. The new content should be
available in the next few days. The easy to remember name of the site is
www.autodeskcom/developinventor

I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve. Specific items will be the most useful.
For example, saying that you want more samples doesn't help very much but
saying that you would like more samples that demonstrate assembly
constraints (for example) will help. This helps in understanding particular
areas of the API that might be more difficult to understand and where we
need to focus efforts in writing more documentation and samples. Besides
samples, any comments on documentation are also very welcome.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5205217@discussion.autodesk.com...
Never seen any books myself. Try this site
http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112

Of note are the zipped documents. Exspecially nice is the DWF of the
Inventor Object Model. Plot it out and hang it on your wall for reference.

Another resource I did not see right away at first was the overviews section
in API help.

What area of the Inventor API did you want to get into?

Regards,
0 Likes
Message 18 of 19

Anonymous
Not applicable
Never mind, Brian. You missed the dot between Autodesk and com
Chris

"Chris (IV11 Pro. SP1 - uninstalled)" wrote in message
news:5212781@discussion.autodesk.com...
Brian,
Has anyone reported to have trouble to get access there.
I tried few times, but couldn't
Thx, Chris

"Brian Ekins (Autodesk)" wrote in message
news:5212363@discussion.autodesk.com...
It's there now.
--
Brian Ekins
Autodesk Inventor API

"Chris (IV11 Pro. SP1 - uninstalled)" wrote in message
news:5211523@discussion.autodesk.com...
Brian,
When it will be available??
I tried to this link and nothing there yet???
Thx, Chris

"Brian Ekins (Autodesk)" wrote in message
news:5206740@discussion.autodesk.com...
Just so you know this site is in the process of being updated with Inventor
11 content, including the object model chart. The new content should be
available in the next few days. The easy to remember name of the site is
www.autodeskcom/developinventor

I would also be interested in hearing from any of you about suggestions
regarding material that you think would be the most beneficial in helping
you to get started using the API and to make it easier to use once you're
over the initial learning curve. Specific items will be the most useful.
For example, saying that you want more samples doesn't help very much but
saying that you would like more samples that demonstrate assembly
constraints (for example) will help. This helps in understanding particular
areas of the API that might be more difficult to understand and where we
need to focus efforts in writing more documentation and samples. Besides
samples, any comments on documentation are also very welcome.
--
Brian Ekins
Autodesk Inventor API

wrote in message news:5205217@discussion.autodesk.com...
Never seen any books myself. Try this site
http://usa.autodesk.com/adsk/servlet/index?id=1079044&siteID=123112

Of note are the zipped documents. Exspecially nice is the DWF of the
Inventor Object Model. Plot it out and hang it on your wall for reference.

Another resource I did not see right away at first was the overviews section
in API help.

What area of the Inventor API did you want to get into?

Regards,
0 Likes
Message 19 of 19

Anonymous
Not applicable
Sorry about the mix-up.
--
Brian Ekins
Autodesk Inventor API

"Chris (IV11 Pro. SP1 - uninstalled)" wrote in message
news:5212785@discussion.autodesk.com...
Never mind, Brian. You missed the dot between Autodesk and com
Chris
0 Likes