I am not sure if it is what you're looking for, but PDMWE2009 has implemented methods for reading BOMs. See the APIguide.
JS
JS2008-11-19
I haven't looked at the 2009 API yet...but in 2008 you had toaccess BOM information through stored SQL procedures.
SF
SF2008-11-20
We're still on 2008 right now and the company is discussinggoing to 2009, but I have no idea when they're going to make adecision on it.
What I'm hoping to be able to do is read a column in a file's BOMknowing the filepath of the file. Do you know if that's evenpossible, and if so, can you point me in the right direction on howto do it?
SF
SF2008-11-20
You'll need to use stored procedures. The stored procedure BomListProc 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.
SF
SF2008-11-20
I don't have access to SQL Management Studio, just VisualStudio 2008 Express. And I can't find anything at all in the APIhelp about anything to do anything with a PDM BOM.
SF
SF2008-11-20
Without SQL Management Studio I think you're going to find itvery difficult to try to get the columns you need from the storedprocs. (They aren't named.) SQL Management Studio is included withSQL Server. There arefreetools you can use as well. SQL Profiler isn't included in theexpress edition, but at least you'll be able to tell what procyou'll need to exec and what the column order is of the result set.
The BOM related methods were implemented in 2009.
SF
SF2008-11-20
Thanks... I'll look into it. Is SQL Management Studiosomething that you use a lot while dealing with PDM? If it is, Ican make a case to my boss that they install it on mycomputer.
JG
JG2008-11-20
Hi Christina,
I would say that for what you are trying to do, it is essential.
Joy
SF
SF2008-11-20
Yippee... more software to learn...
I'm beginning to think I should have never let on that I knewanything at all about programming.. lol As soon as they found outthat I coded websites and e-stores and stuff in my side businessthey hijacked me from drafting into programming for PDM... funfun... lol
Do either of you know if there is any reason why I would have tohave the paid version of SQL Management Studio instead of Express?
Thanks so much for your help Joy and Lee!
SF
SF2008-11-20
You have PDMWE, so you have SQL Mgmt Studio. It's on the SQLServer install disk. (And it's much better than the expressversion.)
SF
SF2008-11-20
Awesome... I'll check with IT and see if it's there and ifthey can install it. Thanks!!
SF
SF2008-11-22
Ok... IT is "considering" my request.. lol
I'm still trying to wrap my head around how exactly SQL is supposedto help me retrieve a column out of the BOM of a file... can eitherof you explain that a little further possibly... ?
JS
JS2008-11-22
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 findthe variable/column you are looking for.
SF
SF2008-11-24
Ok.. that makes more sense.
Is there any documentation anywhere on using storedprocedures?
JS
JS2008-12-01
MSDN is the place I go for most VB needs.
SF
SF2008-12-01
I go there a lot for VB help too... I was thinking thatstored procedures was a PDMWE thing though.. I take it that it's aVB thing?
SF
SF2008-12-01
Stored procedures are a feature of SQL. Google for "usingstored procedures to fill a dataset".
SF
SF2008-12-01
Thank-You guys for all your help! And for being patient withme... I'm a fast learner, but there's a ton of info out there, andI'm not always sure what I should be looking for.
I googled it.. and I understand the concept of stored proceduresnow.
Can I access the stored procedures in PDM's database through VB.NETwithout have SQL Server Management Studio so I can do that"BomListProc" procedure to get the information I need from theBOM?
JS
JS2008-12-01
Having the Management Studio is very helpful, especiallywhile debugging. However it is not required.
SF
SF2008-12-01
Yeah... I agree from what I've read up on about it, it wouldbe very helpful... but our IT department doesn't want to give methe software unless it absolutely required to do my job.. they getvery nervous when it comes to people creating and editingdatabases.
And after I run that procedure, how do I access the BOMinformation?
Another alternative would be to save out the CSV file of BOM via aprogram and then work with it... would that be better/worse thantrying to run a stored procedure to get the BOM?
JS
JS2008-12-01
After you have the BOM in the dataset, you can access it viathe dataset's methods and properties.
The CSV file should be the same data. The downside I see is thatthe CSV file would need to be created, where you can get the BOMdirectly in the stored procedure.
SF
SF2008-12-01
The procedure may or may not be called BomListProc. PDMWEappends a numeric value to the end of the procedure name thatcorresponds with your custom column sets (if any).
If your IT department won't install the software, use the expressversion. At any rate, they can create a readonly user/login for youto use so that you can't make any changes to the database.
As for the CSV/stored proc question, I would go with the storedprocedure. Why introduce more code when you don't need to?
SF
SF2008-12-01
How would I go about finding out the name of the procedurefor my installation if it's based off custom column sets?
I can't use the express version either, my IT department has ourcomputers locked down so that we can't install software on ourmachines and it won't let the installer run. And they "could"create a read-only login for me, but they won't. They are VERYparanoid. Our official programmer for our engineering dept used towork at a government location that was locked down with securityclearances, and he said our IT has more things locked down thanthey did. It's a pain when you're trying to do your job and theywon't give you what you need to do it.
As far as the CSV/stored procedure question... I would normallyagree with you as far as introducing new code, but the code isalready written to work off a CSV file.. that's what we were doinginitially with the program was saving them out manually and thenrunning the program. It just occurred to me that I should be ableto get that same information programatically and be able toeliminate that step for the user.
Is it even possible to save off a csv file of the BOM with aprogram, or am I looking at the same issues as I'm dealing with onstored procedures?
Again... thank-you all for your help with this!
SF
SF2008-12-01
Without PDMWE 2009 installed you'd be facing the same senariowith CSV as you are now with stored procs. With 2009, one hasaccess to BOMs natively. I honestly don't see the need to use CSV.Use stored procedures.
ThisMSDN article willhelp you find what you're looking for. Run the query and it willlist the stored procedures in the database along with theirparameters.
SF
SF2008-12-01
So with 2009, I'd have API access to the BOM's? Making thisprocess SOOO much simpler... that figures... And they're tossingaround the idea of upgrading.. but who knows when they'll maketheir mind up on that.
I'll check over that article and see what I can do with it. Thanksagain for your help!!
SF
SF2008-12-02
Grrrr... one wall after another... can that code be ranwithout login information for the SQL database?
MD
MD2008-12-02
Basically you can't connect to the database to do anythingwithout having a login to SQL Server. However, you could write aPDM report in which you can query the database just as a storedprocedure would. You can then export the results.
SF
SF2008-12-02
The guy in charge of maintaining our company's databases isvery very paranoid, and doesn't want to provide login informationto the database, read-only or otherwise. On one hand I canunderstand him being cautious... but at the same time, I can't hurtit with a read-only login, so it's just ridiculous.
Can you offer any explanation of how to do what you're suggestingMike? I'm not familiar with writing PDM reports.
MD
MD2008-12-02
PDMWE includes a report generator tool which you can use torun reports by going to Windows Explorer while in a vault andselecting Tools > Report Generator... from the menu. There is anexample file in C:\Program Files\PDMWorks Enterprise\ called ReportExamples 1.crp which you can open with Notepad. The ReportGenerator has the option to export the results.
There are several examples you can look at. It's prettyself-explanatory but the key sections are the Arguments and Sqlsections. I have a pdf called Reports-How to create your ownPDMWorks Enterprise Reports that I thought I got from theKnowledgeBase but I searched and now can't find it in the KB. I'mnot sure I'm allowed to distribute it. Perhaps Joy Garon can helpout with that.
You'll need to know which table(s) and columns contain the info youdesire. Again, somewhat difficult without having access to thedatabase. IMHO SolidWorks should provide this information forpeople in your situation.
JS
JS2008-12-02
...but can the report generator be used to show theBOM?
SF
SF2008-12-02
Unfortunately... looks like it doesn't matter if it can beused to show the BOM anyway... IT has struck again!
I don't have permission to run queries when I go into the reportgenerator! Geez this is annoying!
I talked with my boss, and he's given me permission to discuss itwith our VAR and see about upgrading us to PDM 2009 so I can usethe BOM functions and dynamic notifications and all that.
JG
JG2008-12-02
Christina -
IT is supposed to be a support organization. Ask your boss if heand the VAR can meet with IT and see if you can get reasonableaccess to perform your job.
Mike -
I searched the KB as well and was surprised to not see the PDF.Isee what I can do.
Joy
SF
SF2008-12-02
Joy - IT pretty much feels that their responsibilities as far as supportgoes are to the company as a whole, not to any individual. And myboss is pretty much of the opinion that as long as we can do itanother way, it's not worth incurring the wrath of IT... and sincewe can have the users manually save out CSV files of the BOM andthen just have the user browse for those CSV's in the program so wecan use them.. we can do it without bothering IT.
You know the Dilbert cartoons and that boss on there and how theyportray their IT department on there... it's like that here... it'scrazy. I've only been here for about 2 years, and it's just insanehow much paranoia and fear of the IT department everyone has here,no one wants to cross them. Which is probably why I've been introuble with them several times... I'm not afraid of them...lol
SF
SF2008-12-03
hey guys I don't know what the topic even about.. Hi christina, I see that you are a API expert programmer, I wish tolearn how to make API's for PDMWE but unfortunately I need to starting learning about API's from 0 to100 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 msnmessenger or yahoo I hope to get your msn messenger or yahoo ID because I got a fewquestions about API and some other things which connected toAdd-ins
Mike
SF
SF2008-12-03
Hello Mike,
I'd be happy to help with what I can, but I am most definitely notan expert API programmer. I started off by learning what I could ofVB through tutorials online, and reading the API guide from PDM andthe dispatch guide for it... and then coming here and asking thepeople that know how to use it questions when I get stuck onsomething.
I don't have MSN messenger or yahoo at work, one of the many thingsbanned by our IT department. I would suggest that if you havequestions, you ask them here on this forum. There aren't anytraining courses for PDM API, and I think it would be verybeneficial to have any questions and their answers documented inthis forum for other users as well as a good reference back for theones that ask the questions.
What would be REALLY nice is if there was a category created inhere for PDMWE API instead of one for API and one forPDMWE...
SF
SF2008-12-04
Thanks for the reply Christina, but its really disappointingnot to have your email because I would like to exchange information and knowledge with youabout PDM Enterprise and other things like SQL, VB anyways, I'm still happy that I would post some question in theforum and people would help by answers
Thanks Christina
SF
SF2008-12-04
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 oneof those people that really believes that forums are verybeneficial, where we're struggling along right now trying to learnthings, other people can benefit from what we discovered as wewent. But I would be glad to help you via email, and we can alwayscome back here and post the problem and solution for others.
SF
SF2008-12-04
Oh that's very kind of you Christina
thank you
WM
WM2011-11-01
Lee, How do you figure out what each one of the stored procedures do? You cannot modify them to look at the code and I tried to view, but it looks like they are encrypted.
LY
LY2011-11-01
Wayne, I sent you a message via your contact form on your website.
BD
BD2013-06-14
Is it a secret?
TW
TW2013-06-14
I think you must have a super secret decoder ring to get that info Brian.
I'd like to know as well
SF
SF2013-06-17
Brian and Tim,
If you want to write BOM's in SQL you basically need to know 2 things, one is how to write a RCTE:
The other is where to find everything. The Xrefs table is the main table you will need but also the XRefConfiguration and the DocumentRevisionConfiguration tables. Also I've only ever needed to pull info from the xrefs table where XrType = 1, otherwise I get tons of recursion errors.
TW
TW2013-06-17
Charley,
Thank you for that but Brian and I are asking about the "apparent" secrecy Lee was alluding to in his reply to Wayne's question about knowing what the stored procedures are.
"Lee, How do you figure out what each one of the stored procedures do? You cannot modify them to look at the code and I tried to view, but it looks like they are encrypted."
I have SQL code that can traverse a tree but I don't think I would try creating a BOM in SQL, the API is probably an easier approach, wouldn't you say?
SF
SF2013-06-17
Tim,
Just depends on what you want to do. Some of the things we build out are more elaborate than API will allow, and a BOM is in essence a report which is something SQL does very well. I suspect this section of the EULA is why it's not on the forum.
<p><span style="background-color: #ffffff; font-size: 10pt; font-family: Arial, sans-serif;">You may not modify or make works derivative of the Software</span><span style="background-color: #ffffff; font-size: 10pt; font-family: Arial, sans-serif;"> or make compilations or collective works that include the Software,</span><span style="background-color: #ffffff; font-size: 10pt; font-family: Arial, sans-serif;">and you may not analyze for purposes competitive to DS SolidWorks, reverse-engineer, decompile, disassemble or otherwise attempt to discover the source code of the Software</span></p><p></p>
TW
TW2013-06-18
Yep, there it is! I am totally blown away by how well versed you are Charley! Thanks for sharing.
What I'm hoping to be able to do is read a column in a file's BOMknowing the filepath of the file. Do you know if that's evenpossible, and if so, can you point me in the right direction on howto do it?
The BOM related methods were implemented in 2009.
I would say that for what you are trying to do, it is essential.
Joy
I'm beginning to think I should have never let on that I knewanything at all about programming.. lol As soon as they found outthat I coded websites and e-stores and stuff in my side businessthey hijacked me from drafting into programming for PDM... funfun... lol
Do either of you know if there is any reason why I would have tohave the paid version of SQL Management Studio instead of Express?
Thanks so much for your help Joy and Lee!
I'm still trying to wrap my head around how exactly SQL is supposedto help me retrieve a column out of the BOM of a file... can eitherof you explain that a little further possibly... ?
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 findthe variable/column you are looking for.
Is there any documentation anywhere on using storedprocedures?
I googled it.. and I understand the concept of stored proceduresnow.
Can I access the stored procedures in PDM's database through VB.NETwithout have SQL Server Management Studio so I can do that"BomListProc" procedure to get the information I need from theBOM?
Is there anything special that I need to know about running storedPDMWE 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 BOMinformation?
Another alternative would be to save out the CSV file of BOM via aprogram and then work with it... would that be better/worse thantrying to run a stored procedure to get the BOM?
The CSV file should be the same data. The downside I see is thatthe CSV file would need to be created, where you can get the BOMdirectly in the stored procedure.
If your IT department won't install the software, use the expressversion. At any rate, they can create a readonly user/login for youto use so that you can't make any changes to the database.
As for the CSV/stored proc question, I would go with the storedprocedure. Why introduce more code when you don't need to?
I can't use the express version either, my IT department has ourcomputers locked down so that we can't install software on ourmachines and it won't let the installer run. And they "could"create a read-only login for me, but they won't. They are VERYparanoid. Our official programmer for our engineering dept used towork at a government location that was locked down with securityclearances, and he said our IT has more things locked down thanthey did. It's a pain when you're trying to do your job and theywon't give you what you need to do it.
As far as the CSV/stored procedure question... I would normallyagree with you as far as introducing new code, but the code isalready written to work off a CSV file.. that's what we were doinginitially with the program was saving them out manually and thenrunning the program. It just occurred to me that I should be ableto get that same information programatically and be able toeliminate that step for the user.
Is it even possible to save off a csv file of the BOM with aprogram, or am I looking at the same issues as I'm dealing with onstored procedures?
Again... thank-you all for your help with this!
ThisMSDN article willhelp you find what you're looking for. Run the query and it willlist the stored procedures in the database along with theirparameters.
I'll check over that article and see what I can do with it. Thanksagain for your help!!
Can you offer any explanation of how to do what you're suggestingMike? I'm not familiar with writing PDM reports.
There are several examples you can look at. It's prettyself-explanatory but the key sections are the Arguments and Sqlsections. I have a pdf called Reports-How to create your ownPDMWorks Enterprise Reports that I thought I got from theKnowledgeBase but I searched and now can't find it in the KB. I'mnot sure I'm allowed to distribute it. Perhaps Joy Garon can helpout with that.
You'll need to know which table(s) and columns contain the info youdesire. Again, somewhat difficult without having access to thedatabase. IMHO SolidWorks should provide this information forpeople in your situation.
I don't have permission to run queries when I go into the reportgenerator! Geez this is annoying!
I talked with my boss, and he's given me permission to discuss itwith our VAR and see about upgrading us to PDM 2009 so I can usethe BOM functions and dynamic notifications and all that.
IT is supposed to be a support organization. Ask your boss if heand the VAR can meet with IT and see if you can get reasonableaccess to perform your job.
Mike -
I searched the KB as well and was surprised to not see the PDF.Isee what I can do.
Joy
IT pretty much feels that their responsibilities as far as supportgoes are to the company as a whole, not to any individual. And myboss is pretty much of the opinion that as long as we can do itanother way, it's not worth incurring the wrath of IT... and sincewe can have the users manually save out CSV files of the BOM andthen just have the user browse for those CSV's in the program so wecan use them.. we can do it without bothering IT.
You know the Dilbert cartoons and that boss on there and how theyportray their IT department on there... it's like that here... it'scrazy. I've only been here for about 2 years, and it's just insanehow much paranoia and fear of the IT department everyone has here,no one wants to cross them. Which is probably why I've been introuble with them several times... I'm not afraid of them...lol
I don't know what the topic even about..
Hi christina, I see that you are a API expert programmer, I wish tolearn how to make API's for PDMWE
but unfortunately I need to starting learning about API's from 0 to100
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 msnmessenger or yahoo
I hope to get your msn messenger or yahoo ID because I got a fewquestions about API and some other things which connected toAdd-ins
Mike
I'd be happy to help with what I can, but I am most definitely notan expert API programmer. I started off by learning what I could ofVB through tutorials online, and reading the API guide from PDM andthe dispatch guide for it... and then coming here and asking thepeople that know how to use it questions when I get stuck onsomething.
I don't have MSN messenger or yahoo at work, one of the many thingsbanned by our IT department. I would suggest that if you havequestions, you ask them here on this forum. There aren't anytraining courses for PDM API, and I think it would be verybeneficial to have any questions and their answers documented inthis forum for other users as well as a good reference back for theones that ask the questions.
What would be REALLY nice is if there was a category created inhere for PDMWE API instead of one for API and one forPDMWE...
because I would like to exchange information and knowledge with youabout PDM Enterprise and other things like SQL, VB
anyways, I'm still happy that I would post some question in theforum
and people would help by answers
Thanks Christina
I would be happy to exchange emails with you as well. I'm just oneof those people that really believes that forums are verybeneficial, where we're struggling along right now trying to learnthings, other people can benefit from what we discovered as wewent. But I would be glad to help you via email, and we can alwayscome back here and post the problem and solution for others.
thank you
Lee, How do you figure out what each one of the stored procedures do? You cannot modify them to look at the code and I tried to view, but it looks like they are encrypted.
Wayne, I sent you a message via your contact form on your website.
Is it a secret?
I think you must have a super secret decoder ring to get that info Brian.
I'd like to know as well
Brian and Tim,
If you want to write BOM's in SQL you basically need to know 2 things, one is how to write a RCTE:
http://msdn.microsoft.com/en-us/library/ms186243(v=sql.105).aspx
The other is where to find everything. The Xrefs table is the main table you will need but also the XRefConfiguration and the DocumentRevisionConfiguration tables. Also I've only ever needed to pull info from the xrefs table where XrType = 1, otherwise I get tons of recursion errors.
Charley,
Thank you for that but Brian and I are asking about the "apparent" secrecy Lee was alluding to in his reply to Wayne's question about knowing what the stored procedures are.
"Lee, How do you figure out what each one of the stored procedures do? You cannot modify them to look at the code and I tried to view, but it looks like they are encrypted."
I have SQL code that can traverse a tree but I don't think I would try creating a BOM in SQL, the API is probably an easier approach, wouldn't you say?
Tim,
Just depends on what you want to do. Some of the things we build out are more elaborate than API will allow, and a BOM is in essence a report which is something SQL does very well. I suspect this section of the EULA is why it's not on the forum.
Yep, there it is! I am totally blown away by how well versed you are Charley! Thanks for sharing.
Tim