Forum Replies Created
February 3, 2015 at 3:17 am in reply to: Automating the Selection of all "hybridShapeCurveExplicit" elements #1515
Hi. Are the elements all named the same? If not, you should still be able to search by type. See a search example here: http://www.scripting4v5.com/additional-articles/the-selection-object-and-search-function/
Hi JuliusCaesar, glad to have you on the forums! I have worked in automotive industry some too. Good luck with your studies!
You need to define what getThickness, getMeterial, etc. are. Try adding the below code after Dim partDoc1 as PartDocument:1234567891011Dim part1 as PartSet part1 = partDoc1.PartDim myParameters As ParametersSet myParameters = partDoc1.Product.UserRefPropertiesDim getThickness, getMaterial, getMass, nom, RealPartNumber As StringgetThickness = myParameters.Item(part1.Name & "\Properties\Thickness").ValueAsStringgetMaterial = myParameters.Item(part1.Name & "\Properties\Material").ValueAsStringgetMass = myParameters.Item(part1.Name & "\Properties\Mass").ValueAsString
It’s finally complete! After working on it on and off for many months, VB Scripting for CATIA V5: Fourth Edition is now available for purchase and download.
FIRST TIME CUSTOMERS:
If you’ve never purchased any edition of VB Scripting for CATIA V5 and you would like to please check out the sales page on my website. There are now three packages available:
VB Scripting for CATIA V5 PDF
VB Scripting for CATIA V5 PDF + Macro Pack
VB Scripting for CATIA V5 PDF + Macro Pack + Tips and Tricks + Bonus Tutorials
Use the coupon code: LAUNCH to get 25% all packages but hurry, this code will expire in 24 hours! Make you purchase now.
If you purchased any of the earlier editions of the ebook from my website you used to be able to login to the site and download the new version. I’ve switched things around so this is no longer possible. Previous customers still get the new edition for free, just follow these steps: If you purchased the earlier edition of…
…the Kindle Version: you should get an email from Amazon notifying you the book has been updated within the next week or so. Login to the Amazon store and update.
…the paperback version: Sorry, I cannot send you a new paperback free of charge but you are able to download the latest version of the book via Kindle (or use a free Kindle app).
…the PDF ebook: You should receive an email from Gumroad letting you know the book has been updated with a download link. If you did not receive an email please wait two days and if you’ve still not recieved anything then simply reply to this message.
If you purchased the earlier PDF edition of the book and now want to upgrade to the new Dedicated or All-in package, please send me an email with a screenshot of your receipt, which package you are interested in, and I’ll send you a special code to purchase the package at a reduced cost.
Whew! OK, I hope that wasn’t too confusing! I look forward to hearing your reviews and macro success stories.
- This reply was modified 2 years, 10 months ago by Emmett Ross.
Welcome to the forum!
1. There is an article here that will give you an idea of how to create a screen shot macro: http://www.scripting4v5.com/additional-articles/screen-shot-macro/ If you have any specific questions about the code please let me know.
2. Are you exporting from CATIA to Excel, Excel to CATIA, or something else? Please explain more what you are trying to do. Also, there are example codes how to export in my book (http://www.scripting4v5.com/books/vb-scripting-for-catia-v5/) and macro pack: http://www.scripting4v5.com/books/catia-macro-pack-download/.
Hi. I’ve worked with Vericut but not Camtool. You can export the spec tree to a TXT file by using the code below. Does that work for you?12345678910111213141516171819202122232425262728293031323334'export the spec tree to either an xls or txt file'---------------------------------------------------Language="VBSCRIPT"Sub CATMain()Dim productDocument1 As DocumentSet productDocument1 = CATIA.ActiveDocument'Input box to select txt or xlsDim exportFormat As StringexportFormat = Inputbox ("Please choose format to export the tree as._ Type either 'xls' or 'txt'")IF exportFormat <> "xls" THENIF exportFormat <> "txt" THENMsgBox "Did not enter txt or xls. Program cancelled please retry macro."Else'Input box to enter name of fileDim partName As StringpartName = Inputbox ("Please enter the file name.")'Input box to enter file locationDim oLocation As StringoLocation = "C:\Macro Files\"productDocument1.ExportData oLocation & partName & "." & _exportFormat,"txt"End IfEnd IfEnd Sub
The 4th edition is almost complete! You can now get a free preview of the book including the entire first chapter and the table of contents here:
Would love to hear any feedback you have.
Thanks for your input Matt! This is what I wanted see when I created the forum – people helping others.
Ramzar, ApplyWorkMode DESIGN_MODE puts CGRs from visualization mode into design mode. Please see this page: http://www.scripting4v5.com/additional-articles/switch-a-product-to-design-mode/
I just finished updating two more chapters! It’s getting close to being complete now. Almost every chapter now has a short quiz at the end to help test your CATIA macro knowledge and understanding of the material.
Hi Ramzar! Thanks for joining the forum and I’m glad my website has been helpful to you.
OK, I just did a quick test and it looks like the code I am using works for TIF files but still exports the detail sheet for PDFs. I’ll have to look into it more why that is.
Hi Dave. Thanks for registering for the forum. Looks like your code is close but you’re subtracting from the count and not actually skipping the detail sheet. Try something like the code shown below where you use IsDetail to check whether the sheet is a detail sheet or not and if so to skip it. Let me know if this works for you.1234567891011121314151617181920'number of files that will be exportedj = 0For i = 1 To DrwSheets.CountSet mySheet = DrwSheets.Item(i)'use IsDetail to check if the sheet is a detail or not'if not a detail sheet then exportIf mySheet.IsDetail = False ThenmySheet.Activate'code to define drawingName heremyDrawing.ExportData drawingName, "pdf"j = j + 1End IfNext
Hi! Thanks for registering for the forum. Can you please provide more information? Have you attempted to write any code yourself? I can help you better if you give a starting point as I don’t have time to write custom code from scratch. THanks! -Emmett
Good news! Out of 14 chapters, I’ve completed updating 7 of them. Stay tuned for more updates.
OK, you should be able to upload pictures up to 5000kb in size now!