Hi @Alexrose1942. You are talking about changing the units of parameter objects. This forum thread is talking about changing the 'default' document level units. The default document level units are set manually within the Document Settings. The document settings button is located on the Tools tab, Options panel. Within that dialog, on the Units tab is where these settings are found manually. That is what they are doing here in this discussion.
If you want a code solution for changing the units of parameters, then it may be better to start a different forum topic for that. Also, you would need to specify all the details of the task, because code needs to be extremely specific.
- What document type would be active when the code starts (part, assembly, drawing)?
- Do you want the code to target only the active document, only target the active document's immediately referenced documents, only target all levels of referenced documents, or the active document and referenced documents?
- If effecting referenced documents, then what document types do you want it to effect (parts, assemblies, drawings)?
- Which parameter types should it target (only UserParameters, or ModelParameters and/or other types too)?
And any other useful details that we may need to know.
Edit: Attached is a text file containing the code for an example iLogic rule you can play around with. It can be ran on any document type. It will 'process' that active document, and it will 'process' all levels of that document's referenced documents, without filtering out any specific document type. The code is modular (multiple routines), with one custom Function routine just for retrieving the Parameters collection from a supplied Document (because it is done differently for models and drawings), and a custom Sub routine just for the primary parameter unit replacement task, designed to process an entire Parameters collection at a time. That second routine could easily be converted to process a single parameter at a time, instead of an entire collection though.
Wesley Crihfield

(Not an Autodesk Employee)