D.S

adndevblog.typepad.com

Auto export driven dimension value to Excel - Manufacturing DevBlog

Auto export driven dimension value to Excel - Manufacturing DevBlog Manufacturing DevBlog The resource for software developers working with Design, Lifecycle and Simulation technologies from Autodesk. Home Subscribe Follow Useful Links Autodesk About this Blog « Find Touching Area of Two Coplanar Faces | Main | Vector of minimum distance » 01/29/2014 Auto export driven dimension value to Excel By  Adam Nagy Sometimes there could be a main dimension that causes the whole model to change, and so the values of the driven dimensions change as well. You could either monitor the main dimension for change using iLogic or one of the driven dimensions. In this case I'm going to do the latter. Let's say we have the following part with a sketch that defines the Width and Height of the base of the model. We also have at the bottom a Driven Dimension associated with a Reference Parameter named DrivenWidth which changes when the Width changes: I then create a rule named DrivenWidthRule which has DrivenWidth=DrivenWidth in it so it will be recognized as a Driving Rule for DrivenWidth - even though it's only affected by Width: DrivenWidthRule: ' To fake a "Driving Rule" DrivenWidth=DrivenWidth ' Actually simply using the parameter would be enough to trigger the rule ' Dim t = DrivenWidth xlsFilePath = "C:\Users\Administrator\Documents\Inventor\MyProject\parameters.xls" ' Write info to excel file GoExcel.Open(xlsFilePath, "Sheet1") ' Find the relevant parameter ' (in case we store many of them) ' Names are in column A with title "Name" i = GoExcel.FindRow(xlsFilePath, "Sheet1", "Name", "=", "DrivenWidth") If i > 0 Then ' Found it ' Values are in column B GoExcel.CellValue(xlsFilePath, "Sheet1", "B" + i.ToString()) = DrivenWidth End If GoExcel.Save GoExcel.Close Now whenever Width changes, it will change DrivenWidth and so DrivenWidthRule will be called which then can update the values in the Excel file:   Posted at 04:35 PM in Adam Nagy , iLogic , Inventor | Permalink | | | Comments Auto export driven dimension value to Excel By  Adam Nagy Sometimes there could be a main dimension that causes the whole model to change, and so the values of the driven dimensions change as well. You could either monitor the main dimension for change using iLogic or one of the driven dimensions. In this case I'm going to do the latter. Let's say we have the following part with a sketch that defines the Width and Height of the base of the model. We also have at the bottom a Driven Dimension associated with a Reference Parameter named DrivenWidth which changes when the Width changes: I then create a rule named DrivenWidthRule which has DrivenWidth=DrivenWidth in it so it will be recognized as a Driving Rule for DrivenWidth - even though it's only affected by Width: DrivenWidthRule: ' To fake a "Driving Rule" DrivenWidth=DrivenWidth ' Actually simply using the parameter would be enough to trigger the rule ' Dim t = DrivenWidth xlsFilePath = "C:\Users\Administrator\Documents\Inventor\MyProject\parameters.xls" ' Write info to excel file GoExcel.Open(xlsFilePath, "Sheet1") ' Find the relevant parameter ' (in case we store many of them) ' Names are in column A with title "Name" i = GoExcel.FindRow(xlsFilePath, "Sheet1", "Name", "=", "DrivenWidth") If i > 0 Then ' Found it ' Values are in column B GoExcel.CellValue(xlsFilePath, "Sheet1", "B" + i.ToString()) = DrivenWidth End If GoExcel.Save GoExcel.Close Now whenever Width changes, it will change DrivenWidth and so DrivenWidthRule will be called which then can update the values in the Excel file:   View the entire comment thread. Please enable JavaScript if you would like to comment on this blog. Search Submit Mfg DevBloggers Adam Nagy Augusto Goncalves Balaji Ramamoorthy Daniel Du Philippe Leefsma Vladimir Ananyev Wayne Brill Xiaodong Liang November 2016 Sun Mon Tue Wed Thu Fri Sat     1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30       Autodesk Blogs ADN DevBlog - AEC Our DevBlog for Revit, Navisworks, AEC and BIM technology APIs. ADN DevBlog - AutoCAD Our DevBlog for AutoCAD and other platform technology APIs. ADN DevBlog - Cloud and Mobile Our DevBlog for Cloud and Mobile technologies. ADN DevBlog - Infrastructure Modeling Our DevBlog for Infrastructure Modeling technology APIs. ADN DevBlog - Manufacturing Our DevBlog for Design, Lifecycle and Simulation technologies. Around the Corner Cyrille Fauvel's Maya platform developer blog - Autodesk Media and Entertainment technology. Civilized Development Isaac Rodriguez's AutoCAD Civil 3D developer blog Dances with Elephants Jim Quanci's blog on partnering with large companies. It's All Just Ones and Zeros Doug Redmond's Vault developer blog Mod the Machine Brian Ekins' and Adam Nagy's Inventor developer blog The 360 View Mikako Harada's BIM 360 developer blog The 3D Web Coder Jeremy Tammik's web and mobile programming blog The Building Coder Jeremy Tammik's Revit developer blog Through the Interface Kean Walmsley's Au