<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: csv script in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925640#M20564</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to import data from a file and use them to create user parameters, the following codes would demostrate that. The file content is like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;P&gt;d1=10 mm&lt;/P&gt;
&lt;P&gt;d2=5 in&lt;/P&gt;
&lt;P&gt;d3=30 degree&lt;/P&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#Author-
#Description-

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        design = adsk.fusion.Design.cast(app.activeProduct)
        if not design:
            ui.messageBox('No active Fusion design', 'Import Spline csv')
            return
        
        dlg = ui.createFileDialog()
        dlg.title = 'Open CSV File'
        dlg.filter = 'Comma Separated Values (*.csv);;All Files (*.*)'
        if dlg.showOpen() != adsk.core.DialogResults.DialogOK :
            return
        
        filename = dlg.filename
        f = open(filename, 'r')
        parameters = design.userParameters
        line = f.readline()
        data = []
        i = 0
        while line:
            pntStrArr = line.split('=')
            for pntStr in pntStrArr:
                data.append( pntStr)
        
            if len(data) &amp;gt;= 2 :
                i += 1
                parameters.add(data[0], adsk.core.ValueInput.createByString(data[1]), '', 'MyParameter{}'.format(i))

            line = f.readline()
            data.clear()            
        f.close()         

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;</description>
    <pubDate>Thu, 26 Nov 2015 05:23:13 GMT</pubDate>
    <dc:creator>marshaltu</dc:creator>
    <dc:date>2015-11-26T05:23:13Z</dc:date>
    <item>
      <title>csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925524#M20563</link>
      <description>&lt;P&gt;is it possible&amp;nbsp;at this time to create&amp;nbsp;a script to take all parameters&amp;nbsp;from a file, they will be user created parameters put it out as a csv file, then have a script to import the csv file and it put's the user parameter back in as user parameters or would it be easyer to put them back in as modle parameters.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this just a question at this time as this would be handy for doing cabint makeing. it is something I may try to do soon but I am not very good with codeing.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 01:40:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925524#M20563</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-26T01:40:10Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925640#M20564</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you just want to import data from a file and use them to create user parameters, the following codes would demostrate that. The file content is like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;P&gt;d1=10 mm&lt;/P&gt;
&lt;P&gt;d2=5 in&lt;/P&gt;
&lt;P&gt;d3=30 degree&lt;/P&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#Author-
#Description-

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        design = adsk.fusion.Design.cast(app.activeProduct)
        if not design:
            ui.messageBox('No active Fusion design', 'Import Spline csv')
            return
        
        dlg = ui.createFileDialog()
        dlg.title = 'Open CSV File'
        dlg.filter = 'Comma Separated Values (*.csv);;All Files (*.*)'
        if dlg.showOpen() != adsk.core.DialogResults.DialogOK :
            return
        
        filename = dlg.filename
        f = open(filename, 'r')
        parameters = design.userParameters
        line = f.readline()
        data = []
        i = 0
        while line:
            pntStrArr = line.split('=')
            for pntStr in pntStrArr:
                data.append( pntStr)
        
            if len(data) &amp;gt;= 2 :
                i += 1
                parameters.add(data[0], adsk.core.ValueInput.createByString(data[1]), '', 'MyParameter{}'.format(i))

            line = f.readline()
            data.clear()            
        f.close()         

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 05:23:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925640#M20564</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2015-11-26T05:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925657#M20565</link>
      <description>&lt;P&gt;Thank you very much&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/561768"&gt;@marshaltu﻿&lt;/a&gt;&amp;nbsp;at the moment I cant do anything with it, for some reasion all paramaters are missing from all of my designs. I am going to have to fix them all before I get back to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 06:06:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925657#M20565</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-26T06:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925761#M20566</link>
      <description>&lt;P&gt;I have been playing with the code if I run it to open a .csv with just the 3 lines you did it works if I try one taken from a sketch it does nothing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the code I am useing to get the paramaters&lt;/P&gt;&lt;PRE&gt;#Author-Brian Ekins
#Description-Dumps out parameter info to a specified csv file.

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        # Get the name of the file to write to.
        fileDialog = ui.createFileDialog()
        fileDialog.isMultiSelectEnabled = False
        fileDialog.title = "Specify result filename"
        fileDialog.filter = 'CSV files (*.csv)'
        fileDialog.filterIndex = 0
        dialogResult = fileDialog.showSave()
        if dialogResult == adsk.core.DialogResults.DialogOK:
            filename = fileDialog.filename
        else:
            return

        des = app.activeProduct

        result = 'Name,Expression,Units,Value (database units),Comment,Type,Component\n'

        # Get the data for all user parameters.
        for userParam in des.userParameters:
            result += (userParam.name + ',' + userParam.expression + ',' + userParam.unit + ',' + 
                       str(userParam.value) + ',' + userParam.comment + ',User\n')

        for comp in des.allComponents:
            for modelParam in comp.modelParameters:
                result += (modelParam.name + ',' + modelParam.expression + ',' + modelParam.unit + 
                           ',' + str(modelParam.value) + ',' + modelParam.comment + ',Model,' + comp.name + '\n')

        output = open(filename, 'w')
        output.writelines(result)
        output.close()
        
        ui.messageBox('File written to "' + filename + '"')

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do i need to change this bit,&amp;nbsp;parameters = design.userParameters to something like below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;# Get the data for all user parameters.&lt;BR /&gt;for userParam in des.userParameters:&lt;BR /&gt;result += (userParam.name + ',' + userParam.expression + ',' + userParam.unit + ',' +&lt;BR /&gt;str(userParam.value) + ',' + userParam.comment + ',User\n')&lt;/P&gt;&lt;P&gt;for comp in des.allComponents:&lt;BR /&gt;for modelParam in comp.modelParameters:&lt;BR /&gt;result += (modelParam.name + ',' + modelParam.expression + ',' + modelParam.unit +&lt;BR /&gt;',' + str(modelParam.value) + ',' + modelParam.comment + ',Model,' + comp.name + '\n')&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 08:25:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925761#M20566</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-26T08:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925817#M20567</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I changed the codes a little bit to read the data exported from Brain's scripts. Now it should work as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note I have to give one space to comments if it is empty in file. There was a bug to create user parameter with empty comments. I have fixed it in our development build. The fix should be availabe in next major update.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#Author-
#Description-

import adsk.core, adsk.fusion, traceback

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        design = adsk.fusion.Design.cast(app.activeProduct)
        if not design:
            ui.messageBox('No active Fusion design', 'Import csv')
            return
        
        dlg = ui.createFileDialog()
        dlg.title = 'Open CSV File'
        dlg.filter = 'Comma Separated Values (*.csv);;All Files (*.*)'
        if dlg.showOpen() != adsk.core.DialogResults.DialogOK :
            return
        
        filename = dlg.filename
        f = open(filename, 'r')
        parameters = design.userParameters
        line = f.readline()
        data = []
        while line:
            pntStrArr = line.split(',')
            for pntStr in pntStrArr:
                data.append( pntStr)
        
            if len(data) &amp;gt;= 5 :
                if data[0] != 'Name' and data[1] != 'Expression': 
                    comments = data[4]
                    if comments == '':
                        comments = ' '
                    parameters.add(data[0], adsk.core.ValueInput.createByString(data[1]), data[2], comments)

            line = f.readline()
            data.clear()            
        f.close()         

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Nov 2015 09:33:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925817#M20567</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2015-11-26T09:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925842#M20568</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/561768"&gt;@marshaltu﻿&lt;/a&gt;&amp;nbsp;it's not working very well it got the first 4 parameters&amp;nbsp;then stopped&amp;nbsp;and came up with an error. i have attached the .csv file I am getting the parameters&amp;nbsp;from, thank you for your help so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just tryed it on another file and it worked. as fails, 11 works, this is going to save me a lot of time thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think what is makeing it fail is what is in the&amp;nbsp;Expression 11 has number and letter's, AS has words it fail on the 5th line what has words it does not matter to much as if this is the problem I can just change it what is in 11 is how I do it now &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 10:09:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925842#M20568</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-26T10:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925882#M20569</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not clear how you generate the file? There were two kinds of errors in the file:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Special character to express "deg". I would like to suggest to replace all of them by "deg".&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;d52,0.0 ∞,deg,0,,Model,layout sheet&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="s1"&gt;2. There was an additional item in Line #6. We have to remove "Draw_depth".&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;d43,Draw_depth - 18 mm,mm,38.2,,Model,Draw`s&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;After I correct the errors, I can import those data and create user parameters.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Marshal&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 10:28:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5925882#M20569</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2015-11-26T10:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5926345#M20570</link>
      <description>&lt;P&gt;Hey Daniel I am actually working on a script to do something really similar. &amp;nbsp;Like you want to be able to switch between different versions of the design really quickly? &amp;nbsp;Might have it done this weekend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Stay tuned.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 16:56:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5926345#M20570</guid>
      <dc:creator>prainsberry</dc:creator>
      <dc:date>2015-11-26T16:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5926538#M20571</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/561768"&gt;@marshaltu&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not clear how you generate the file? There were two kinds of errors in the file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Special character to express "deg". I would like to suggest to replace all of them by "deg".&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;d52,0.0 ∞,deg,0,,Model,layout sheet&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2. There was an additional item in Line #6. We have to remove "Draw_depth".&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN&gt;d43,Draw_depth - 18 mm,mm,38.2,,Model,Draw`s&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN&gt;After I correct the errors, I can import those data and create user parameters.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN&gt;Marshal&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/561768"&gt;@marshaltu&lt;/a&gt;&amp;nbsp;I have look at some other Model's they have 1. the same that's down to fusion.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just did a quick test this is what should comes up from a press pull&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;d2&lt;/TD&gt;&lt;TD&gt;0.00 °&lt;/TD&gt;&lt;TD&gt;deg&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Model&lt;/TD&gt;&lt;TD&gt;(Unsaved)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all the spots where there is a&amp;nbsp;deg&amp;nbsp;in the files paramaters like above for press pull,&amp;nbsp;some are&amp;nbsp;like above, but others have a number string changeing them to 0 fixes the problem like you said.&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the paramater's they are fine it is when they are dumped to the csv file,&amp;nbsp;some have gone&amp;nbsp;bad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is a link to the file&amp;nbsp;&lt;A href="http://a360.co/1Q09V2U" target="_blank"&gt;http://a360.co/1Q09V2U&lt;/A&gt; if you have a look your self you will see they are fine until you dump the file to a csv, it could mean the are not at 0 deg they could be a bit out of squire&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just did this file&amp;nbsp;&lt;A href="http://a360.co/1NaBCRt" target="_blank"&gt;http://a360.co/1NaBCRt&lt;/A&gt; it has the same problem as the file above.&amp;nbsp;&lt;/P&gt;&lt;P&gt;so what is makeing this happen I would not have a clue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. that's how I use to do the paramater's I use letter code's now&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 20:37:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5926538#M20571</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-26T20:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5926542#M20572</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2549199"&gt;@prainsberry&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Hey Daniel I am actually working on a script to do something really similar. &amp;nbsp;Like you want to be able to switch between different versions of the design really quickly? &amp;nbsp;Might have it done this weekend.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Stay tuned.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;take you time your meant to be on holiday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sound good it would be good to have a script where you build one model&amp;nbsp;say a cabint then you can run a script that will fire out a copy but it opens a dialog so you can change the sizeing before it&amp;nbsp;builds that model as a new model. this would make the hobby boys quite happy and cabint maker's. doing scripts like this would make fusion a almost do everything program and should get you a pay rise.&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Nov 2015 20:44:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5926542#M20572</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-26T20:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927510#M20573</link>
      <description>&lt;P&gt;Now you are talking sounds good to me haha. &amp;nbsp;Unfortunately this is actually what I think is fun to do on my holiday &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check this out. &amp;nbsp;I am still seeing some problems when you try to un-suppress many features at once but the parameters parts is working pretty good if you want to take a look at it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/tapnair/configSaver" target="_blank"&gt;https://github.com/tapnair/configSaver&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will still probably work on it a bit more before making a video or anything. &amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Let me know what you think.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2015 21:37:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927510#M20573</guid>
      <dc:creator>prainsberry</dc:creator>
      <dc:date>2015-11-27T21:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927580#M20574</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2549199"&gt;@prainsberry﻿&lt;/a&gt;&amp;nbsp;it took a bit to work out how to use it, I think I am not useing it correctly what am I supost to do with the xml file&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2015 00:12:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927580#M20574</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-28T00:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927604#M20575</link>
      <description>You should not have to do anything with the xml.  Just save a config then you can set the model back to it.  I'll make a quick video.


Regards,
Patrick Rainsberry</description>
      <pubDate>Sat, 28 Nov 2015 01:10:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927604#M20575</guid>
      <dc:creator>prainsberry</dc:creator>
      <dc:date>2015-11-28T01:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927859#M20576</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2815263"&gt;@daniel_lyall﻿&lt;/a&gt;&amp;nbsp;hey i think i made it a little easier to use. &amp;nbsp;Download the updated version. &amp;nbsp;Seperated the save configuration from the switch configuration into two commands. &amp;nbsp;Let me know what you think.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also made a super quick video here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://youtu.be/9VTTctoid2E" target="_blank"&gt;https://youtu.be/9VTTctoid2E&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2015 14:47:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5927859#M20576</guid>
      <dc:creator>prainsberry</dc:creator>
      <dc:date>2015-11-28T14:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928009#M20577</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2549199"&gt;@prainsberry﻿&lt;/a&gt;&amp;nbsp;I was using&amp;nbsp;it wrong got the idea now.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;supper dupper job dude. it will save time for making bespoke&amp;nbsp;stuff, now I just need to see if it will work with a nested cabinet&amp;nbsp;what is linked to the original model, if it does you just need to make one Model, one nested copy and just run through each change&amp;nbsp;in cam and post as you are going.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it's going to make changing&amp;nbsp;my custom&amp;nbsp;wheelchair table east as.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thank you&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2549199"&gt;@prainsberry﻿&lt;/a&gt;&amp;nbsp;I will put you in for a payrise&amp;nbsp;&lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://forums.autodesk.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2015 19:44:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928009#M20577</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-28T19:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928039#M20578</link>
      <description>&lt;P&gt;it's good for finding mistakes as well&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Nov 2015 20:36:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928039#M20578</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-28T20:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928739#M20579</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am aware that there is a setting to control if unit (deg) or symbol(o) is shown in parameter dialog, which might impact the results outputed to dump file by Brian's script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could find the setting by right-top corner -&amp;gt; "Your account" -&amp;gt; Preferences -&amp;gt; Units and Value Display -&amp;gt; "Display symbols for units" and just uncheck the option for workaround. Though I can export unit as "deg" since I check the option in my machine. I am not clear if any region settings in your machine impact the results. My region is en-US.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;About "&lt;SPAN&gt;d43,Draw_depth - 18 mm,mm,38.2,,Model,Draw`s&lt;/SPAN&gt;", I found it wasn't an error. Sorry for misleading. It was saying parameter "d43" depended on parameter "Draw_depth". We might need some enhancement to deal with the dependencies among parameters in Brian's script so that the dependent parameters can be exported firstly. For example: "Draw_depth" would be prior to "d43".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looked "prainsberry" has provided other solution for you. Please let me know if you still need these&amp;nbsp;scripts.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 03:35:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928739#M20579</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2015-11-30T03:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928767#M20580</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/561768"&gt;@marshaltu﻿&lt;/a&gt;&amp;nbsp;yer it's a bit funny that, that paramater failed &amp;nbsp;and other's did not but you may be correct about the order that info get's spat out, could well be the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the&amp;nbsp;&lt;SPAN&gt;deg thing they where from the press pull and they could be at that angle in the sketch but sinces the press pull was not done at a angle it could be stuffing it up, that's over my head.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have changed the way I set up the parmater's now and none of them have failed at all, the way I use to do it they can have the same problem, some have done the same thing.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it works fine with how I do it now and yes I still will use it, it saves a lot of typeing if you think you can make it better go for it other wise what ever goes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thank you for all the work you have done.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;the stuff&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2549199"&gt;@prainsberry﻿&lt;/a&gt;&amp;nbsp;has done is really good for doing changes once's the model has been done and the other bits he has added, it's the bees knees. the two together makes life just that bit more easy, for what I do.if he could added it into his script that be even better, it's good haveing all his scripts in the same place. I use them quite often.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;anyway thankyou both of you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Nov 2015 04:30:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5928767#M20580</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-11-30T04:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5930403#M20581</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I changed a little bit the script to dump out paramaters from design. Now it should be able to handle dependencies among parameters. Please let me know if you see any issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Marshal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;#Author-Brian Ekins
#Description-Dumps out parameter info to a specified csv file.

import adsk.core, adsk.fusion, traceback

def insertParameter(param, allParams):
    allParams.append(param)
    dependentParams = param.dependentParameters
    for dependentParam in dependentParams:
        if dependentParam in allParams:
            allParams.remove(dependentParam)
            allParams.append(dependentParam)

def run(context):
    ui = None
    try:
        app = adsk.core.Application.get()
        ui  = app.userInterface
        
        # Get the name of the file to write to.
        fileDialog = ui.createFileDialog()
        fileDialog.isMultiSelectEnabled = False
        fileDialog.title = "Specify result filename"
        fileDialog.filter = 'CSV files (*.csv)'
        fileDialog.filterIndex = 0
        dialogResult = fileDialog.showSave()
        if dialogResult == adsk.core.DialogResults.DialogOK:
            filename = fileDialog.filename
        else:
            return

        des = app.activeProduct

        # Get sorted parameter list according to dependencies
        allParams = []
        modelParamCompNames = {}
        for userParam in des.userParameters:
            insertParameter(userParam, allParams)
            
        for comp in des.allComponents:
            for modelParam in comp.modelParameters:
                insertParameter(modelParam, allParams)
                modelParamCompNames[modelParam.name] = comp.name

        result = 'Name,Expression,Units,Value (database units),Comment,Type,Component\n'
        
        # Get the data for all parameters.
        for param in allParams:
            compName = modelParamCompNames.get(param.name)
            if compName != None:
                result += (param.name + ',' + param.expression + ',' + param.unit + 
                           ',' + str(param.value) + ',' + param.comment + ',Model,' + compName + '\n')
            else:
                result += (param.name + ',' + param.expression + ',' + param.unit + ',' + 
                       str(param.value) + ',' + param.comment + ',User\n')

        output = open(filename, 'w')
        output.writelines(result)
        output.close()
        
        ui.messageBox('File written to "' + filename + '"')

    except:
        if ui:
            ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Dec 2015 03:35:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5930403#M20581</guid>
      <dc:creator>marshaltu</dc:creator>
      <dc:date>2015-12-01T03:35:23Z</dc:date>
    </item>
    <item>
      <title>Re: csv script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5930424#M20582</link>
      <description>&lt;P&gt;thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/561768"&gt;@marshaltu﻿&lt;/a&gt;&amp;nbsp;that work's better one small problem tryed a file with a scale in it, it failed at&amp;nbsp;the line before it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the line&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;d64&lt;/TD&gt;&lt;TD&gt;0.1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;0.1&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Model&lt;/TD&gt;&lt;TD&gt;12mm finger tenions (2)&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;there are a few scale's in the sketch, it fail at the one like above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if it is like this d64_1 it's fine&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;all other files work, other that if there is a scale like above.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2015 04:43:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/csv-script/m-p/5930424#M20582</guid>
      <dc:creator>daniel_lyall</dc:creator>
      <dc:date>2015-12-01T04:43:28Z</dc:date>
    </item>
  </channel>
</rss>

