Showing posts with label units. Show all posts
Showing posts with label units. Show all posts

Wednesday, 17 February 2016

Rounding Parameters, Part 2

If you have been struggling to use parameter functions like round, ceil, floor, isolate (which converts units for parameters) or similar then you will need to know this. I have been playing with this before and it was only recently that I have found some hidden help pages which explain why I had this problem and how to solve it.

round'n round


The more you live the mode you learn and I hope it stays this way for a long time; I know there is a regression curve but I don’t want to taste it. Avid for knowledge I am glad I learned something new so I had to write it down for you and me; I am in this way hoping it won’t perish in the back of my mind.

The solution I found last time was to increase precision by multiplying with10 or one if it’s powers, then use the function and then divide by that number again. Not elegant or good looking but it did the trick until I found the correct solution for this.

So it seems that units are evaluated before mean value of the parameter and in order to evaluate the numerical part you first need to get rid of the units.

How do we do that? We simply divide and multiply by the parameter units like this: "round(5.8 / 1 mm) * 1 mm"

Get rid of those units first.

The help page has a probably better example so shamelessly I will share it.

Units are evaluated before the arithmetic portion of an expression. Therefore, the power operator applies to a unit before it applies to an adjacent numeric value. For example:
2 m^2
does not evaluate to 4 square meters, but rather means 2 square meters. The correct syntax is:
(2 m)^2 = 4 m^2

There is a lot of info about syntax errors as well like when you mix units with unitless values without explicitly specifying this. That’s when you get that red text in the functions window so make sure you glimpse over the help pages here (2016) or here (2014), if the page is no more, search Google for “Formulas and equations for expressions reference” or “Expression Reference for Numeric Parameters”.

Later,

Ads.



photo credit: snowing (license)

Wednesday, 3 February 2016

Tube and Pipe Units

Question: How do we change TP units? And how Inventor decides which units to use for new runs and routes?               
Spaghetti pipe measuring
I have been investigating this a while back and didn’t have time to search deeply but I get this question a lot so I decided to test and find the answer once and for all.

                It is quite logic as you will see.

                Any already created documents need to be manually changed by editing that document using the Tools / Document Settings / Units tab / Length drop-down field. What do I mean by documents? “Tube and Pipe Runs” assembly, any “Run”, any “Route” and it goes the same for hoses.

Change model units.
                I think you will only edit the routes really and one thing to understand is that the dimensions will be displayed in the route units, but when you edit that dimension you will have the original value + original units you entered. For example you created a route with a segment length of 1500mm and then you change the units to inches, then the dimension will report 59.055 but when you edit the dimension you will see 1500mm(mind the explicit units). In other words any existing values will be kept and interpreted (converted) while any new dimensions, parameters, will get new units. You can change units for existing parameters but I wouldn't bother.

Dimension units vs reported units.
Any new files you create will get the units of the parent document. For example if your files were created in mm and you suddenly decide the new Runs or Routes to be inches then you need to first edit its parent document.

If you need to create all New Routes in inches then you first need to edit the parent Run and set it to inches.

If you need to create all New Runs in inches then you first need to change the “Tube and Pipe Runs” document to inches.

HOWEVER any generated pipe segments will have the units set as per CC (Content Center) family settings. Using ASME pipes will get you inch lengths of pipes while using DIN, ISO, etc. styles will generate metric lengths. No matter what units you have in the T&P assembly, Run or Route the pipes will use the CC family units.

Pipe units in parts list.
BOM and drawing Parts List will get units from the pipe segments so if you have mixed styles (metric, imperial) then you will get mixed units.

To emphasize this you can add a “BASE UNIT” column on the parts list which should help spotting different units.

Emphasize units in Parts List.
Using Material Lists with cumulated lengths is safe since you are probably merging the parts by stock number or part number and these will have same “unit” type.

"One Unit to rule them all, .... and in the darkness bind them" ?

If you need to unify the reported length you can change formatting for QTY column in the parts list and force one unit for all. 

Right click the quantity column and choose Format Column. Tick the Apply Units Formatting box and on the Units drop-down select the common units to be used, then click OK in the Format Column window.
Formating lengths to a common unit.
Back to the assembly environment, you can either open the documents or edit them in the current assembly. Some documents are tricky to open like Routes which can only be open either using the open command and browse for it on disk, or by selecting it in the browser or graphical window and then use “right click on graphical window” and choose “open”. It’s the only way to open a route as a separate document.

The only way to open routes.
                TIP: Here’s how to save documents if the main assembly is open. If the main assembly is open and you decide to open a run, route, separately then you need to do the changes in the open document but save the main assembly. Some files can only be saved in the context of the main assembly.

Later,
ADS

photo credit: Measured (license)

Friday, 30 October 2015

Reported Length


In one of my previous post I’ve shown you how to change length parameter format for steel shapes in Content Center (CC) so that assembly Bill of Materials (BOM) will have no trailing zeros and round up the value to a 1 mm increment.


On that post I gave you a bit of ilogic code that can change formatting of files you might have generated already which can come in hand and can be used with code injector.

At that time I didn’t realized that you might not use the assembly BOM to report your lengths but use the drawing Parts List so in this post we will look at doing just that.

If your company uses Parts Lists then you might be lucky and saved yourself a good couple of day’s work where you needed to copy all the default libraries to a custom read-write and then editing all the templates to report correct length parameters.

The Parts Lists can be formatted just like the parameter display and you can show/hide, trailing or leading zeros, units string or even change units to: in, mm, cm, m, ft, yard, mi, or microns.

Double click on your table or right click and choose “Edit Parts List...” either on the browser or graphical window.

Right click the quantity column and choose “Format Column...”. In the format column window you can specify a new name for the column, change text justification and most importantly you can change units formatting.


Click on “Apply Units Formatting” to activate the submenus. Now you can change trailing or leading zeros, change units type, units and precision. It can be configure to report a different measurement unit, to change decimal from "." to "," and you can choose if you need to have the units string displayed at all.


If you use the Materials List table style supplied with Inventor you will have to modify the Substitution tab in the format cell window. In the Substitution window you might have “Enable Value Substitution” and “When exists, use value of” PL. This is helpful for those that do Tube and Pipe where the reported parameter for pipe length is PL.


And of course there’s a catch. Your units will be rounded but you need to be careful because you can have it rounded up or rounded down. Both can cost you and rounding up an expensive material can be just as expensive as rounding down and not having enough to complete your design.


My settings will keep units to mm but will remove trailing zeros and set precision to 0 decimals. Most workshops will not need or manufacture to less than 1mm increments but this is for you to decide.

In this way you can keep the default formatting of CC and keep working with the out of the box libraries without the hassle of copying or editing them.

Later,
ADS


Thursday, 17 September 2015

Length parameter format

Those of you working with frame generator or with content center steel shapes know that in order to get the length parameter to display correctly you need to edit the parameter formatting.

So how do we change the content center steel shape template?

Now you have two options:
The first one would be to open the file from Content Center and for that you can click on the big I top left (inventor menu) and in the open flyout menu choose Open from Content Center.
The second option is to edit an already generated file or create one by using place from content center in an assembly.
Once you have the part open you can edit and format the parameter display and then you will need to update family template in content center using this new file.

Let’s detail the first option which seems a bit quicker as well. You need to copy the family first and then generate the file because otherwise Inventor will complain that the new template is not a valid file.

- To copy the content center family to a read-write library like My Library provided by default use the Content Center Editor from the Mange tab, Content Center pane and browser to the family.

- Right click the family and copy it to your library.


- Click on big I top left and from the Open fly-out menu choose Open from Content Center, then choose the family you just copied and in the member window make sure you choose Place as Custom. Length and size it's not important so choose any.


- It will then prompt you for a save location and then will open the file for you. Now you can edit the parameters removing trailing, leading, units, and change precision to suit you.


- Now you need to edit Content Center again with the Manage button and then change from Merged View to your library (THIS IS IMPORTANT) or the extra commands will not be available.

- On the contextual right-click menu choose Replace Family Template and select the file you have edited.


So how about all those files generated already?

 Unfortunately you need to open and edit each and every file individually or use code injector and run this code.

Code injector can be found here and the original ilogic code was posted on the autodesk forum by Curtis Waguespack so head over to the original post and give him kudos.


'-------------start of ilogic code ----------------

'get the parameter
oPL = Parameter.Param("G_L")
'export the paramter as an iProperty
oPL.ExposedAsProperty = True
'set the parameter as a custom property
oFormat=oPL.CustomPropertyFormat
'set the custom iProperty as a text type
oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType
'set the precision
oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kThreeDecimalPlacesPrecision
'set the unit type
oFormat.Units="mm"
'set to show/not show the unit string (use True to show)
oFormat.ShowUnitsString=False
'set to show/not show the trailing zeros (use True to show)
oFormat.ShowTrailingZeros = False
'set to show/not show the leading zeros (use True to show)
oFormat.ShowLeadingZeros = False

'-------------end of ilogic code ----------------

Thursday, 27 August 2015

Tube and Pipe mixed units

 This is really a question from a YouTube friend and I have no other way of answering with images and videos so I’ve decided to share it on a blog.

The question is how to use ASME pipes with ISO 7005 flanges?  Or better yet, how to create mixed styles, mixed units routes?

2 ways really and the second is more of a cheat that I don’t recommend since Autodesk has provided a solution that is working which is to use mixed units.

+Chris Benner has documented this really nice and you can check his blog here:

In short when you edit the style make sure you check the Mixed Units box and then you will be prompted to select a flange. The flange family needs to have dual units and you will notice just like in my case for the 7005-01 flange there are 2 nominal size columns, one in metric and one imperial and that’s how Inventor can use it in mixed units styles.



If you have a flange that has only one column as key with the sizes then you can add another column with its alternate unit.

The second one is a cheat and almost not worth mentioning but you can copy the family to your library and edit the key column values to its alternate units therefore it will be picked up by the TP style dialog. I bet it will take you just about same time to do it properly by adding a new column with its alternate units.




 Later,
ADS
               



Thursday, 11 June 2015

Inventor Assembly Template

                There is a lot of info on the internet on how to setup your template files and many of you have already configured the drawing template, adding title blocks, borders and some symbols maybe. You have probably edited the part template and changed the default material but chances are that you haven’t altered your assembly template too much if at all.
                I am saying this because I see recurring questions popping out every once in while by frustrated people doing repetitive tasks that could have been avoided with a proper setup of their assembly template.
                One of the main things that will save a lot of frustration would be to setup a new design view representation as default instead of the locked “Master”. God knows how many times I’ve found Assemblies that cannot be saved because of the “Main design view is locked” error.



TIP: Instead of locating the template file and folder you can create a new file using New command and then save those changes in the template using Inventor (big I top left) / Save As / Save Copy As Template command.

                So open your standard.iam file template or fire up the new assembly command. Create a new design view representation, I call mine “Default” and set is as active. This will become the default view and hopefully if you don’t manually change it back to Master you should get over that pesky error on editing locked design views.
                The next one up is BOM. By default the Structured tab is disabled and every time you place a Parts List or edit the BOM you need to activate it. You then set it to All Levels, you may change the default delimiter and most certainly you will add and remove columns to suit your design needs.
So why don’t you go ahead and make these changes persistent in the template?


Depending on your design process and needs you might not use this but I recommend that you add Item QTY to your BOM. This will report the cumulated number of instances in the BOM. The default QTY will report the number of items as long as the item doesn’t have a length (G_L parameter) like structural sections, pipes, etc. in which case it will report cumulated length and not the number of items in the assembly.



                I feel better already, anything else?
                I use a lot of Content Center and Purchase Parts that are library read-only items and when doing large assemblies it’s hard to navigate the browser to find that part you want to edit. So what I like to do is add two folders called CC (Content Center) and PP (Purchased Parts) where I group the files to clean up the browser keeping just the normal parts. It makes a huge difference to be able to find something fast not to hunt and pick all the time. Also, you can now suppress hide or disable a whole folder at a time ;)



                Nice... what else?
                How about adding some virtual parts? This is where you get creative and to utilise the tip above you might want to add them to a folder called Virtual. It’s better to add as much you can think off and then delete them in the assembly later if not used. Creative? Like what? Stuff like oil, grease, man hour costs, machining costs, shipment, painting, etc. Remember that you have Estimated Cost on iproperties and virtual parts although exist in the assembly only they do have iproperties just like any other parts. You can even add a long descriptive text in the comments field. Do you need to add the Estimated Cost to BOM? How about Comments then?



                Keep going please!
                 Anything you need changing in the Document Settings? Maybe you want to change the default Lightning Style, maybe not but you might want to change the default dimension display to “Display as expression” to see the full equation driving that dimension. In here you can change the units as well as modelling precision. Verify all the tabs and make sure there’s nothing else that needs changing.

                Is this it?
                On the short list you might also consider:
·         Deactivating the Contact Solver in Inspect Tab
·         Parameters that you keep adding all the time like bounding box dimensions.
·         Link or embed some excel files
·         Add various iLogic Forms if needed
·         Add some iLogic code like one to prompt you to fill in iProperties at first save.
·         Turn on Center of Gravity
·         Etc.

I suggest that every time you find yourself changing settings in an assembly pause and think if this is something that might be saved in the template. If you do this for a week then you’ve probably got most of things but it’s a good exercise to do every once in a while especially with each new Inventor release.
               

Later,

ADS.