Showing posts with label replace. Show all posts
Showing posts with label replace. Show all posts

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 ----------------

Wednesday, 29 October 2014

Tube and Pipe: multiple selection change size

Edit:
Thank you all for your votes, the idea was accepted and expect this to work with all CC center files. So from V2016 you should be able to select multiple CC files and do change size it should work for all
End Edit.

It's been a terrible week but I've managed to have anther post on the Inventor Idea Station so if you like it maybe you will cast a vote and get it promoted as new functionality.

Original post:
Haven't found this on the idea station. I am trying to get something similar as "replace should replace all selected components" but for tube and pipe elements.
When you do a run sometimes you need to change size of multiple fittings and pipes.
I don't mean change the style.
On a 2" run I can have a drain or sample valve and I need to change just those end fittings and pipes without affecting the whole run or without doing another separate run.

If you select multiple elements (content center items) there is no change size option. I have "CS" as change size shortcut but it only changes the first element selected.





 Again, if you like this maybe you will vote the change.

ADS.

Tuesday, 30 September 2014

Replace fitting error

I've seen a post the other day on the Autodesk Inventor forum regarding an error that the program throws when trying to replace fittings. The error is "Replace fitting error!"


You will notice if your parts are authored fittings if the thumbnail in the assembly browser looks like a blue tee.



In the assembly the commands "Replace" and "Replace all" are throwing the error.
The solution in this case is to restart inventor with the routed systems addin disabled. Once active it picks up on these parts and they can only be replaced with replace fitting command.




And the video:


Thursday, 10 July 2014

AutoCAD advanced search replace

A couple of words on Autocad search replace. Autocad has the functionality built in and for simple things is good enough.
For example when I need to change pipe size on a P&I D I can select the labels and use the properties (CTRL+1) to change the attribute text all at once.

If you need to change different types of notes, blocks, texts, multiline-text etc. then you can use the Search/Replace functionality

You can search in Entire drawing / Current space/layout or in selection (pre selected object or on the spot)

On the result list you can select just part of the items before doing replace.

But what if you need to do a complex search replace? This won’t do.
I had to change Cable Schedule in several acad drawings and all I was given was an excel file.  Luckily I had the previous revision of the excel file and I could make a list of old - new name. Lee Mac has created a script that can do that for you. The script is called BFind and here’s how I used it.
                 This is what the Acad looks like.
                 And this is what we will end up with.


Once you load the BFindV2-0.lsp script in you acad session (you can drag drop it on your drawing) run it by typing BFind and you should get the following window.


In here you can search replace in current drawing, all open drawings, folder,  folder with subfolders. You don’t want to type all text changes one at a time but rather use a text document with the values from excel so here’s how to do that.
You need to add something in the search replace fields and save it as a text for reuse late. You can then open the reuse text document and add your texts. Load it back in the BFind window an hit ok.

Let’s add Find: ADS ad Replace with: ADS1 then click Save. Click OK for changes to take effect and then open windows explorer and let’s locate the file.  Do a search on C: drive for a file name that contains LMAC BFind. Mine was located here:
C:\Users\adrian.salariu\AppData\Roaming\Autodesk\AutoCAD Mechanical 2015\R20.0\enu\Support\LMAC_BFind_SavedSearches_V2-0.txt
Open it up and check to make sure it contains our saved Search Items List.



Add your text in and save the document. In Autocad run BFind and click on Load to load your list.
After selecting your search location (drawing, folder , etc.) click OK and go get a coffee till it’s done.

This saved me a couple of hours of boring, mind-numbing work. Hope it helps you as well. Here's the link to Lee's web page.


ADS 

Quick Inventor Parameters

I have been working on a tank template driven with ilogic and ifeatures and I needed to add a lot of parameters for all my connections.
You can go to Inspect \ Parameter and use Export Parameters to get them out in xml format. You can then edit this with Notepad or any text editor and add your changes. You can add new values to a Multi-Value parameter or add new parameters.

I have copied one set and used paste and then replace to change the parameter name and values.
Then I have saved and imported the file back in Inventor to get them in my template.


A parameter starts with <ParamWithValue> and ends with <\ParamWithValue> just like my example bellow.
<ParamWithValue>
      <name>N10_Size</name>
      <typeCode>String</typeCode>
      <value>2"</value>
      <comment>Connection 10 size</comment>
      <isKey>false</isKey>
      <multiValues>
        <string>0.5"</string>
        <string>0.75"</string>
        <string>1"</string>
        <string>1.25"</string>
        <string>1.5"</string>
        <string>2"</string>
        <string>3"</string>
        <string>4"</string>
        <string>6"</string>
      </multiValues>
    </ParamWithValue>


ADS