eksiah Posted August 29, 2013 Share Posted August 29, 2013 Hello everyone. i have a request from my tool maker in machine shop and need help on this We need the material size (W x L x H) or (Dia x L) to be automatic updated and shown on idw (title block) so that they can prepare the material easily for squaring process. Possible to have an i-Logic or other method to enable the Inv2012Pro automatic update the (W,L,H) or (Dia,L) when saving the file and before exit ? Very very thanks in advance. Quote Link to comment Share on other sites More sharing options...
KennyJ Posted September 3, 2013 Share Posted September 3, 2013 This link might also help. It explains how to make parameters available to custom iProperties. Good stuff. http://design-excellence.teknigroup.com/tutorials/Inventor/Parameter-iProperties.html Quote Link to comment Share on other sites More sharing options...
eksiah Posted September 4, 2013 Author Share Posted September 4, 2013 hi Kenny, Very thanks for info. Now i need to figure out how it can recalculate automatically if (let say) i extruded another 20mm from one end from original Length. Quote Link to comment Share on other sites More sharing options...
KennyJ Posted September 4, 2013 Share Posted September 4, 2013 I got it! try running this iLogic rule. We just need to learn how to apply the message box output to parameters now! Dim Length As Decimal = 0.0 Dim Height As Decimal = 0.0 Dim Width As Decimal = 0.0 Length = Measure.ExtentsLength Height = Measure.ExtentsHeight Width = Measure.ExtentsWidth Dim SLength As String = Length.ToString() Dim SHeight As String = Width.ToString() Dim SWidth As String = Height.ToString() MessageBox.Show("L = " + SLength + vbNewLine + "W = " + SWidth + vbNewLine + "H = " + SHeight , "Part Size") Quote Link to comment Share on other sites More sharing options...
KennyJ Posted September 4, 2013 Share Posted September 4, 2013 Ok I figured it out 2 minutes after posting. You will need to create 3 custom iProperties. length width height Then run this rule. Dim Length As Decimal = 0.0 Dim Height As Decimal = 0.0 Dim Width As Decimal = 0.0 Length = Measure.ExtentsLength Height = Measure.ExtentsHeight Width = Measure.ExtentsWidth Dim SLength As String = Length.ToString() Dim SHeight As String = Width.ToString() Dim SWidth As String = Height.ToString() iProperties.Value("Custom", "length") = SLength iProperties.Value("Custom", "width") = SWidth iProperties.Value("Custom", "height") = SHeight Quote Link to comment Share on other sites More sharing options...
eksiah Posted September 7, 2013 Author Share Posted September 7, 2013 Hi Kenny, Very very thanks you for the code Really appreciated and i can auto insert it the idw when printing drawings. Below is what i have changed little bit on the codes Dim oLength As Decimal Dim oHeight As Decimal Dim oWidth As Decimal oLength = Round(Measure.ExtentsLength,2) oHeight = Round(Measure.ExtentsHeight,2) oWidth = Round(Measure.ExtentsWidth,2) Dim SLength As String = oLength.ToString() Dim SHeight As String = oHeight.ToString() Dim SWidth As String = oWidth.ToString() iProperties.Value("Custom", "Length") = SLength iProperties.Value("Custom", "Height") = SHeight iProperties.Value("Custom", "Width") = SWidth 'MessageBox.Show("Length = " + SLength + vbNewLine + "Width = " + SWidth + vbNewLine + "Height = " + SHeight , "Part Size") Quote Link to comment Share on other sites More sharing options...
KennyJ Posted September 9, 2013 Share Posted September 9, 2013 You're welcome, I'm glad I could help! It's not often I can actually offer a solution around here. Plus I learned a little bit about iLogic while trying to solve this. Quote Link to comment Share on other sites More sharing options...
Lazer Posted September 9, 2013 Share Posted September 9, 2013 Nice to see some iLogic code getting shared on this site and working together to get an end result;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.