Hello,
In my title block I have a material section that pulls to iProperties from the model
One is material, which displays the material used in the model
and the other is manually input by me in the comments section of the model, I typically only use this field for sheet metal description, example, .125 Sheet Metal, this saves me from a drawing view to show thickness only.
In my sheet metal template I have checked the little box for the thickness model parameter so it will show up as a custom property - model.
So i can display the thickness parameter anytime the sheet metal base view is placed.
My issue is I want the thickness property to have the following with it "Sheet Metal"
But I only want this to appear if the base view is in fact sheet metal, all other parts and assemblies, this field would be blank,
So this is what I want when a sheet metal part is placed:
This is what I want to display when a part is placed:
This is what I get when anything is placed:
Sheet Metal shows up because:
I am looking for help for a Rule that will only apply <Thickness> Sheet Metal to my title block only if the base view is in fact a sheet metal part. Is this possible??
Thanks for any help!
Solved! Go to Solution.
Solved by jdkriek. Go to Solution.
Scratch that, this thread was my option B attempt,
I managed to get Option A to finally work over here...which is a much simpler solution!!
For curiosity sake though this is what I was working on for a rule to grab thickness, but couldnt quite get there. Anyone know how to pull the Thickness Parameter from a Sheet Metal part and give a result showing <Thickness> Sheet Metal (ex. .125 in Sheet Metal)
'Sheet Metal Thickness into Title Block if base view is a sheet metal part
doc = ThisDoc.Document customPropertySet = doc.PropertySets.Item("Inventor User Defined Properties")
'Make sure SheetMetalThickness property exists Try prop = customPropertySet.Item("SheetMetalThickness") Catch 'Assume error means not found customPropertySet.Add("", "SheetMetalThickness") End Try 'Find the filename of the model used in the drawing If ThisDoc.ModelDocument Is Nothing Then Goto handleErrors ElseIf ThisDoc.ModelDocument.DocumentType = kPresentationDocumentObject Goto handleErrors Else modeldocname = IO.Path.GetFileName(ThisDoc.ModelDocument.FullFileName) End If 'Find the Thickness of the sheet metal model used in the drawing SheetMetalThickness = "TEST" 'Write the thickness of the model to the SheetMetalThickness custom iProperty. iProperties.Value("Custom", "SheetMetalThickness") = SheetMetalThickness InventorVb.DocumentUpdate() Exit Sub handleErrors: 'do nothing InventorVb.DocumentUpdate()
Thanks In Advance!
You're working way to hard! (to quote JDM )
This is all you need.
iProperties.Value("Custom", "SheetMetalThickness") = Thickness & " Sheet Metal"
I am slowly becoming to think I was better off without logic! Simply because I know what I want to do, but can never seem to get there!
I managed to get the <Sheet Metal Rule> to insert into my titleblock..Great!!
But now, when I create any other Standard Parts (non sheet metal) the material section of my title block will not auto-fill because it is searching for <Sheet Metal Rule>
Is there a way for a rule to:
I know i can create 2 different drawing templates, but ideally, I would like to keep just one for all my drawing purposes.
There must be a way to determine base view properties, then apply the iproperties based on that??
Thanks!
I, personally, don't like automating from the drawing side. It seems to always get messy. (We can do it that way if neccessary, but it's just not as pretty.)
I would set this up as a rule in the part template that populates a single property field with whatever information you want. We can determine from there whether it's a sheet metal part type or make use of some other means that you prefer to toggle methods of defining the property. From there it's trivial to write whatever data you want to the property.
Let me know exactly what you want and I'll be happy to whip something up for you.
I agree with Matt. My ConstructStockNumber iLogic is in the part files. The rule in the sheetmetal template formats one way and the rule(s) in other templates format another way.
But you can easily determine what type of part is open. Here's an example.
Dim oDoc = ThisApplication.ActiveDocument If oDoc.DocumentType = kPartDocumentObject Then 'Confirm part If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 'Confirm Sheetmetal MsgBox("Sheetmetal Format") Stock = "PL " & dThickness Else 'Confirm Standard MsgBox("Standard Format") Stock = "PL " & RoundToFraction(dThickness, 1/32, RoundingMethod.RoundUp) End If iProperties.Value("Project", "Stock Number") = UCase(Stock) End If
From where I am at now, i think the simplist solution is to create this rule in the drawing template.
My workflow is create part or sheet metal part, fill a few iProperties, then once I insert my Base View onto drawing sheet, the drawing sheet is auto-filled.
If we can make a rule to do this, then I don't have to do anything to my part templates.
Also I know the easiest way to do this is to have 2 separate drawing templates, one that calls out the sheet metal rule property and the other will call out the simple material property, but if possible, I would like to have just one drawing template.
Thanks for your help!!
hmm..i am not quite understanding then what it is you mean, in regards to having the rule in the part/sheet metal templates, how would I show the material of either a part or sheet metal component when the base view is inserted into the sheet.
For a standard part, i use the "material" iProperty and "comment" iProperty if more info is require
For Sheet Metal, the custom iProperty "<Sheet Metal Rule> "is used to relay what size and material of sheet metal is used.
I don't quite understand how to make the rules in the modeling templates apply to my drawing templates.(
Thanks!!
I might be catching on,
So in a rough example here, on my drawing sheet I would have a custom iProperty in the titleblock called, lets say "CustomMaterial"
In my Standard part template, a rule that would take the material used in the part and apply it to "CustomMaterial"
and within my Sheet Metal template, a rule would take my <Sheet Metal Rule> and apply it to "CustomMaterial"
so what ever part/model is placed onto the drawing sheet the iProperty "CustomMaterial" will populate the material used information to the title block??
or something along these lines?
either way, if you guys say it is best to leave the drawing sheet, then I will, but I am not sure how to continue either way.
Thanks
When you insert properties into your drawing title block or sketched symbols you can choose where that property comes from. In this case I have written to the Stock Number in the model, so I simply insert that into my drawing block. Which then of course displays automaticly when a view is inserted.
Ok, for material in a Standard part, I placed the material iproperty and this autofills no problem
but the problem occurs when I drop a sheet metal part, because I want more than just the material to show up,
maybe this image will help explain...
Thanks!
Basically, I am avoiding manual input of values such as stock number etc...material is pre-determined by selection in modeling and my sheet metal rules are pre-defined as well in the sheet metal template.
Thanks
My thoughts exactly Matt.
In this case MaterialInfo custom iProperty (or whatever you want) in the models will drive the drawing. If it's sheetmetal then it will contain SheetMetalRule custom iProperty else it will contain just the Material.
Dim oDoc = ThisApplication.ActiveDocument If oDoc.DocumentType = kPartDocumentObject Then 'Confirm part If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 'Confirm Sheetmetal Stock = iProperties.Value("Custom", "SheetMetalRule") Else 'Confirm Standard Stock = iProperties.Material End If iProperties.Value("Custom", "MaterialInfo") = Stock End If
Thanks Jon and Matt!!
Been using Inventor everyday for over a year now and everyday you or someone else shows me something new!!
The seems to be working perfectly!!
send me a message if you ever end up in Sudbury, Ontario, I'll buy ya a drink!!
Thanks again!
You are quite welcome Sean, glad we could point you in the right direction. 😉
Btw, it never hurts to have a little error checking:
Dim oDoc = ThisApplication.ActiveDocument If oDoc.DocumentType = kPartDocumentObject Then 'Confirm part If oDoc.SubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then 'Confirm Sheetmetal Try: Stock = iProperties.Value("Custom", "SheetMetalRule") Catch: MsgBox("SheetMetalRule iProperty Doest not exist") End Try Else 'Confirm Standard Stock = iProperties.Material End If Try: iProperties.Value("Custom", "MaterialInfo") = Stock Catch: MsgBox("MaterialInfo iProperty Doest not exist") End Try Else MsgBox("File is not a part") End If
Hello I hope you can help me, I just finished a sheet ire gradually modifying it through a multipurpose form iLogic em. The problem is this, I have in the box are several factors that will automatically fill because and easily schedule (NAME, SCALE, DATE, NO PLANO, ETC), however when a plane of a piece is done it automatically takes the material thereof and copies it to the box (there's no problem) the problem is that when he said assembly is not true for obvious reasons, what I want is to know how to sack the code in iLogic that when it is a this delimiting assembly can say (mixed or not Applicable N / A) through iLogic way or another. Thank you very much, Deputy sheet inventor 2015 version and given me blows to the head and not give how to solve this problem. Cheers Link leaf .....
https://forums.autodesk.com/autodesk/attachments/autodesk/120/59353/1/Captura.JPG