I would like to use the P/N as part of my view label. However, I need to truncate the characters shown. (see attachment)
Regarding attachment:
-first snippet is of my label formatting
-second snippet is current results
-third snippet is desired results
thanks in advance for any help.
Solved! Go to Solution.
I would like to use the P/N as part of my view label. However, I need to truncate the characters shown. (see attachment)
Regarding attachment:
-first snippet is of my label formatting
-second snippet is current results
-third snippet is desired results
thanks in advance for any help.
Solved! Go to Solution.
Solved by Curtis_Waguespack. Go to Solution.
Hi @Anonymous,
I think you'd need to use a bit of iLogc code, to do this. Would you want all of the views on the sheet to be updated? Or just select one view at a time?
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hi @Anonymous,
I think you'd need to use a bit of iLogc code, to do this. Would you want all of the views on the sheet to be updated? Or just select one view at a time?
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
I would prefer to update one view at a time.
thanks
I would prefer to update one view at a time.
thanks
Hi @Anonymous,
Here is a quick iLogic rule to do this:
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet If oSSet.count = 0 Then MessageBox.Show("You must select a drawing view first", "iLogic") Exit Sub End If 'Reference to the drawing view from the 1st selected object Dim oView As DrawingView = trycast(oSSet.item(1), DrawingView) If oView IsNot Nothing Then oView.ShowLabel = True 'get the part number from the model in the view oPN = "<Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property>" oPartNumber = "<StyleOverride Underline='True'>" & oPN & "</StyleOverride>" 'set temp view label oView.Label.FormattedText = oPartNumber 'add ITEM and get last 2 digits oPN2 = "ITEM " & Right(oView.Label.Text,2) 'format text for view label oPartNumber = "<StyleOverride Underline='True'>" & oPN2 & "</StyleOverride>" oStringScale = "<Br/><StyleOverride Underline='False'>" & "SCALE <DrawingViewScale/>" & "</StyleOverride>" oDescription = "<Br/><StyleOverride Underline='False'>" & _ "<Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>" 'add to the view label oView.Label.FormattedText = oPartNumber & oDescription & oStringScale Else MessageBox.Show("The selected object is not a drawing view", "iLogic") End If
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
related link:
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Hi @Anonymous,
Here is a quick iLogic rule to do this:
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet If oSSet.count = 0 Then MessageBox.Show("You must select a drawing view first", "iLogic") Exit Sub End If 'Reference to the drawing view from the 1st selected object Dim oView As DrawingView = trycast(oSSet.item(1), DrawingView) If oView IsNot Nothing Then oView.ShowLabel = True 'get the part number from the model in the view oPN = "<Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property>" oPartNumber = "<StyleOverride Underline='True'>" & oPN & "</StyleOverride>" 'set temp view label oView.Label.FormattedText = oPartNumber 'add ITEM and get last 2 digits oPN2 = "ITEM " & Right(oView.Label.Text,2) 'format text for view label oPartNumber = "<StyleOverride Underline='True'>" & oPN2 & "</StyleOverride>" oStringScale = "<Br/><StyleOverride Underline='False'>" & "SCALE <DrawingViewScale/>" & "</StyleOverride>" oDescription = "<Br/><StyleOverride Underline='False'>" & _ "<Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>" 'add to the view label oView.Label.FormattedText = oPartNumber & oDescription & oStringScale Else MessageBox.Show("The selected object is not a drawing view", "iLogic") End If
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
related link:
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Thanks Curtis! That works great. I do have one last request...
Is it possible to have the first line of text height be at .18 in and the next two lines be at .125 in?
I appreciate your assistance.
Tim
Thanks Curtis! That works great. I do have one last request...
Is it possible to have the first line of text height be at .18 in and the next two lines be at .125 in?
I appreciate your assistance.
Tim
Hi @Anonymous,
Try this version. Note that the Font Size numbers are in centimeters.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet If oSSet.count = 0 Then MessageBox.Show("You must select a drawing view first", "iLogic") Exit Sub End If 'Reference to the drawing view from the 1st selected object Dim oView As DrawingView = trycast(oSSet.item(1), DrawingView) If oView IsNot Nothing Then oView.ShowLabel = True 'get the part number from the model in the view oPN = "<Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property>" oPartNumber = "<StyleOverride Underline='True'>" & oPN & "</StyleOverride>" 'set temp view label oView.Label.FormattedText = oPartNumber 'add ITEM and get last 2 digits oPN2 = "ITEM " & Right(oView.Label.Text,2) 'format text for view label oPartNumber = "<StyleOverride Underline='True' FontSize=' 0.4572'>" & oPN2 & "</StyleOverride>" oStringScale = "<Br/><StyleOverride Underline='False' FontSize=' 0.3175' >" & "SCALE <DrawingViewScale/>" & "</StyleOverride>" oDescription = "<Br/><StyleOverride Underline='False' FontSize=' 0.3175'>" & _ "<Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>" 'add to the view label oView.Label.FormattedText = oPartNumber & oDescription & oStringScale Else MessageBox.Show("The selected object is not a drawing view", "iLogic") End If
Hi @Anonymous,
Try this version. Note that the Font Size numbers are in centimeters.
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet If oSSet.count = 0 Then MessageBox.Show("You must select a drawing view first", "iLogic") Exit Sub End If 'Reference to the drawing view from the 1st selected object Dim oView As DrawingView = trycast(oSSet.item(1), DrawingView) If oView IsNot Nothing Then oView.ShowLabel = True 'get the part number from the model in the view oPN = "<Property Document='model' PropertySet='Design Tracking Properties' Property='Part Number' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='5'>PART NUMBER</Property>" oPartNumber = "<StyleOverride Underline='True'>" & oPN & "</StyleOverride>" 'set temp view label oView.Label.FormattedText = oPartNumber 'add ITEM and get last 2 digits oPN2 = "ITEM " & Right(oView.Label.Text,2) 'format text for view label oPartNumber = "<StyleOverride Underline='True' FontSize=' 0.4572'>" & oPN2 & "</StyleOverride>" oStringScale = "<Br/><StyleOverride Underline='False' FontSize=' 0.3175' >" & "SCALE <DrawingViewScale/>" & "</StyleOverride>" oDescription = "<Br/><StyleOverride Underline='False' FontSize=' 0.3175'>" & _ "<Property Document='model' PropertySet='Design Tracking Properties' Property='Description' FormatID='{32853F0F-3444-11D1-9E93-0060B03C1CA6}' PropertyID='29'>DESCRIPTION</Property></StyleOverride>" 'add to the view label oView.Label.FormattedText = oPartNumber & oDescription & oStringScale Else MessageBox.Show("The selected object is not a drawing view", "iLogic") End If
Can't find what you're looking for? Ask the community or share your knowledge.