46 Replies Latest reply on Jun 18, 2013 3:03 PM by Tim Webb

    Can PDMWE API access a BOM???

    Christina Seay
      Does anyone know if you can use the API in PDMWE to read a column out of a BOM for a drawing file?
        • Can PDMWE API access a BOM???
          I am not sure if it is what you're looking for, but PDMWE 2009 has implemented methods for reading BOMs. See the API guide.
          • Can PDMWE API access a BOM???
            Jeff Sweeney
            I haven't looked at the 2009 API yet...but in 2008 you had to access BOM information through stored SQL procedures.
            • Can PDMWE API access a BOM???
              Christina Seay
              We're still on 2008 right now and the company is discussing going to 2009, but I have no idea when they're going to make a decision on it.

              What I'm hoping to be able to do is read a column in a file's BOM knowing the filepath of the file. Do you know if that's even possible, and if so, can you point me in the right direction on how to do it?
              • Can PDMWE API access a BOM???
                You'll need to use stored procedures. The stored procedure BomListProc<number> will return what you're looking for. If you have access to SQL Management Studio, (with SQL Profiler installed) run a trace on a non-production server and select an assembly. You'll see the stored proc run. You'll need to do some work with it, but it's not impossible.
                • Can PDMWE API access a BOM???
                  Christina Seay
                  I don't have access to SQL Management Studio, just Visual Studio 2008 Express. And I can't find anything at all in the API help about anything to do anything with a PDM BOM.
                    • Can PDMWE API access a BOM???
                      Without SQL Management Studio I think you're going to find it very difficult to try to get the columns you need from the stored procs. (They aren't named.) SQL Management Studio is included with SQL Server. There are free tools you can use as well. SQL Profiler isn't included in the express edition, but at least you'll be able to tell what proc you'll need to exec and what the column order is of the result set.

                      The BOM related methods were implemented in 2009.
                    • Can PDMWE API access a BOM???
                      Christina Seay
                      Thanks... I'll look into it. Is SQL Management Studio something that you use a lot while dealing with PDM? If it is, I can make a case to my boss that they install it on my computer.
                      • Can PDMWE API access a BOM???
                        Christina Seay
                        Yippee... more software to learn...

                        I'm beginning to think I should have never let on that I knew anything at all about programming.. lol As soon as they found out that I coded websites and e-stores and stuff in my side business they hijacked me from drafting into programming for PDM... fun fun... lol

                        Do either of you know if there is any reason why I would have to have the paid version of SQL Management Studio instead of Express?

                        Thanks so much for your help Joy and Lee!
                        • Can PDMWE API access a BOM???
                          You have PDMWE, so you have SQL Mgmt Studio. It's on the SQL Server install disk. (And it's much better than the express version.)
                          • Can PDMWE API access a BOM???
                            Christina Seay
                            Awesome... I'll check with IT and see if it's there and if they can install it. Thanks!!

                            • Can PDMWE API access a BOM???
                              Christina Seay
                              Ok... IT is "considering" my request.. lol

                              I'm still trying to wrap my head around how exactly SQL is supposed to help me retrieve a column out of the BOM of a file... can either of you explain that a little further possibly... ?

                              • Can PDMWE API access a BOM???
                                Jeff Sweeney
                                The actual BOM of an assembly is not really stored anywhere. It is calculated on the fly via the stored procedure Lee mentioned.

                                This stored procedure can be used to return a dataset to your code. Once you have your dataset, you'll need to interrogate it to find the variable/column you are looking for.
                                • Can PDMWE API access a BOM???
                                  Christina Seay
                                  Ok.. that makes more sense.

                                  Is there any documentation anywhere on using stored procedures?
                                  • Can PDMWE API access a BOM???
                                    Jeff Sweeney
                                    MSDN is the place I go for most VB needs.
                                    • Can PDMWE API access a BOM???
                                      Christina Seay
                                      I go there a lot for VB help too... I was thinking that stored procedures was a PDMWE thing though.. I take it that it's a VB thing?
                                      • Can PDMWE API access a BOM???
                                        Stored procedures are a feature of SQL. Google for "using stored procedures to fill a dataset".
                                        • Can PDMWE API access a BOM???
                                          Christina Seay
                                          Thank-You guys for all your help! And for being patient with me... I'm a fast learner, but there's a ton of info out there, and I'm not always sure what I should be looking for.

                                          I googled it.. and I understand the concept of stored procedures now.

                                          Can I access the stored procedures in PDM's database through VB.NET without have SQL Server Management Studio so I can do that "BomListProc" procedure to get the information I need from the BOM?
                                          • Can PDMWE API access a BOM???
                                            Jeff Sweeney
                                            Having the Management Studio is very helpful, especially while debugging. However it is not required.
                                            • Can PDMWE API access a BOM???
                                              Christina Seay
                                              Yeah... I agree from what I've read up on about it, it would be very helpful... but our IT department doesn't want to give me the software unless it absolutely required to do my job.. they get very nervous when it comes to people creating and editing databases.

                                              Is there anything special that I need to know about running stored PDMWE procedure through vb.net or does something like:
                                              http://www.howtodothings.com/c...edure-from-vbnet.html
                                              pretty much cover it?

                                              And after I run that procedure, how do I access the BOM information?

                                              Another alternative would be to save out the CSV file of BOM via a program and then work with it... would that be better/worse than trying to run a stored procedure to get the BOM?
                                              • Can PDMWE API access a BOM???
                                                Jeff Sweeney
                                                After you have the BOM in the dataset, you can access it via the dataset's methods and properties.

                                                The CSV file should be the same data. The downside I see is that the CSV file would need to be created, where you can get the BOM directly in the stored procedure.
                                                • Can PDMWE API access a BOM???
                                                  Christina Seay
                                                  How would I go about finding out the name of the procedure for my installation if it's based off custom column sets?

                                                  I can't use the express version either, my IT department has our computers locked down so that we can't install software on our machines and it won't let the installer run. And they "could" create a read-only login for me, but they won't. They are VERY paranoid. Our official programmer for our engineering dept used to work at a government location that was locked down with security clearances, and he said our IT has more things locked down than they did. It's a pain when you're trying to do your job and they won't give you what you need to do it.

                                                  As far as the CSV/stored procedure question... I would normally agree with you as far as introducing new code, but the code is already written to work off a CSV file.. that's what we were doing initially with the program was saving them out manually and then running the program. It just occurred to me that I should be able to get that same information programatically and be able to eliminate that step for the user.

                                                  Is it even possible to save off a csv file of the BOM with a program, or am I looking at the same issues as I'm dealing with on stored procedures?

                                                  Again... thank-you all for your help with this!
                                                    • Can PDMWE API access a BOM???
                                                      Without PDMWE 2009 installed you'd be facing the same senario with CSV as you are now with stored procs. With 2009, one has access to BOMs natively. I honestly don't see the need to use CSV. Use stored procedures.

                                                      This MSDN article will help you find what you're looking for. Run the query and it will list the stored procedures in the database along with their parameters.

                                                    • Can PDMWE API access a BOM???
                                                      Christina Seay
                                                      So with 2009, I'd have API access to the BOM's? Making this process SOOO much simpler... that figures... And they're tossing around the idea of upgrading.. but who knows when they'll make their mind up on that.

                                                      I'll check over that article and see what I can do with it. Thanks again for your help!!
                                                      • Can PDMWE API access a BOM???
                                                        Christina Seay
                                                        Grrrr... one wall after another... can that code be ran without login information for the SQL database?
                                                        • Can PDMWE API access a BOM???
                                                          Michael Dekoning
                                                          Basically you can't connect to the database to do anything without having a login to SQL Server. However, you could write a PDM report in which you can query the database just as a stored procedure would. You can then export the results.
                                                          • Can PDMWE API access a BOM???
                                                            Christina Seay
                                                            The guy in charge of maintaining our company's databases is very very paranoid, and doesn't want to provide login information to the database, read-only or otherwise. On one hand I can understand him being cautious... but at the same time, I can't hurt it with a read-only login, so it's just ridiculous.

                                                            Can you offer any explanation of how to do what you're suggesting Mike? I'm not familiar with writing PDM reports.



                                                            • Can PDMWE API access a BOM???
                                                              Michael Dekoning
                                                              PDMWE includes a report generator tool which you can use to run reports by going to Windows Explorer while in a vault and selecting Tools > Report Generator... from the menu. There is an example file in C:\Program Files\PDMWorks Enterprise\ called Report Examples 1.crp which you can open with Notepad. The Report Generator has the option to export the results.

                                                              There are several examples you can look at. It's pretty self-explanatory but the key sections are the Arguments and Sql sections. I have a pdf called Reports-How to create your own PDMWorks Enterprise Reports that I thought I got from the KnowledgeBase but I searched and now can't find it in the KB. I'm not sure I'm allowed to distribute it. Perhaps Joy Garon can help out with that.

                                                              You'll need to know which table(s) and columns contain the info you desire. Again, somewhat difficult without having access to the database. IMHO SolidWorks should provide this information for people in your situation.
                                                              • Can PDMWE API access a BOM???
                                                                Jeff Sweeney
                                                                ...but can the report generator be used to show the BOM?
                                                                • Can PDMWE API access a BOM???
                                                                  Christina Seay
                                                                  Unfortunately... looks like it doesn't matter if it can be used to show the BOM anyway... IT has struck again!

                                                                  I don't have permission to run queries when I go into the report generator! Geez this is annoying!

                                                                  I talked with my boss, and he's given me permission to discuss it with our VAR and see about upgrading us to PDM 2009 so I can use the BOM functions and dynamic notifications and all that.
                                                                  • Can PDMWE API access a BOM???
                                                                    Christina Seay
                                                                    Joy -
                                                                    IT pretty much feels that their responsibilities as far as support goes are to the company as a whole, not to any individual. And my boss is pretty much of the opinion that as long as we can do it another way, it's not worth incurring the wrath of IT... and since we can have the users manually save out CSV files of the BOM and then just have the user browse for those CSV's in the program so we can use them.. we can do it without bothering IT.

                                                                    You know the Dilbert cartoons and that boss on there and how they portray their IT department on there... it's like that here... it's crazy. I've only been here for about 2 years, and it's just insane how much paranoia and fear of the IT department everyone has here, no one wants to cross them. Which is probably why I've been in trouble with them several times... I'm not afraid of them... lol
                                                                    • Can PDMWE API access a BOM???
                                                                      Mike Adam
                                                                      hey guys
                                                                      I don't know what the topic even about..
                                                                      Hi christina, I see that you are a API expert programmer, I wish to learn how to make API's for PDMWE
                                                                      but unfortunately I need to starting learning about API's from 0 to 100
                                                                      I think its possible to become from (Zero to hero) in programming

                                                                      I would be happy if you have time to have a conversation on msn messenger or yahoo
                                                                      I hope to get your msn messenger or yahoo ID because I got a few questions about API and some other things which connected to Add-ins

                                                                      Mike
                                                                      • Can PDMWE API access a BOM???
                                                                        Christina Seay
                                                                        Hello Mike,

                                                                        I'd be happy to help with what I can, but I am most definitely not an expert API programmer. I started off by learning what I could of VB through tutorials online, and reading the API guide from PDM and the dispatch guide for it... and then coming here and asking the people that know how to use it questions when I get stuck on something.

                                                                        I don't have MSN messenger or yahoo at work, one of the many things banned by our IT department. I would suggest that if you have questions, you ask them here on this forum. There aren't any training courses for PDM API, and I think it would be very beneficial to have any questions and their answers documented in this forum for other users as well as a good reference back for the ones that ask the questions.

                                                                        What would be REALLY nice is if there was a category created in here for PDMWE API instead of one for API and one for PDMWE...
                                                                        • Can PDMWE API access a BOM???
                                                                          Mike Adam
                                                                          Thanks for the reply Christina, but its really disappointing not to have your email
                                                                          because I would like to exchange information and knowledge with you about PDM Enterprise and other things like SQL, VB
                                                                          anyways, I'm still happy that I would post some question in the forum
                                                                          and people would help by answers

                                                                          Thanks Christina
                                                                          • Can PDMWE API access a BOM???
                                                                            Christina Seay
                                                                            I didn't mean it that way... my email is cseay@astecinc.com

                                                                            I would be happy to exchange emails with you as well. I'm just one of those people that really believes that forums are very beneficial, where we're struggling along right now trying to learn things, other people can benefit from what we discovered as we went. But I would be glad to help you via email, and we can always come back here and post the problem and solution for others.
                                                                            • Can PDMWE API access a BOM???
                                                                              Mike Adam
                                                                              Oh that's very kind of you Christina

                                                                              thank you