# Creating/designing SFC charts through scripts \[dynamic\]

**URL:** <https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [April 13, 2023, 4:17am UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388 "2023-04-13T04:17:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vigneshwaranp](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vigneshwaranp](https://forum.inductiveautomation.com/u/vigneshwaranp)\
**Post date:** [April 13, 2023, 4:17am UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/1 "2023-04-13T04:17:02Z")

</div>

Hi,  
I would like to know if there are any options to create or design the SFC charts dynamically using scripting or some other means.?  
I do see one possibility of creating the sfc.xml through scripting and try that way, but I'm not sure regarding the unique id's for each element that gets created and is it like normal guid? or is that stored internally anywhere? or will it get referenced in chaining items? etc...  
If there are some pointers to reference article or any shareable info regarding this, it will be of great help.

thanks

---

<div class="post-metadata">

**Author:** ![michael.edmonson](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@michael.edmonson](https://forum.inductiveautomation.com/u/michael.edmonson)\
**Post date:** [June 8, 2023, 4:32pm UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/2 "2023-06-08T16:32:46Z")

</div>

did you ever figure anything out on this?

---

<div class="post-metadata">

**Author:** ![vigneshwaranp](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vigneshwaranp](https://forum.inductiveautomation.com/u/vigneshwaranp)\
**Post date:** [June 13, 2023, 2:51am UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/3 "2023-06-13T02:51:02Z")

</div>

Not yet, looking for guidance or best practices from anyone who has done similar to this here

---

<div class="post-metadata">

**Author:** ![michael.edmonson](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@michael.edmonson](https://forum.inductiveautomation.com/u/michael.edmonson)\
**Post date:** [June 14, 2023, 2:34pm UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/4 "2023-06-14T14:34:15Z")

</div>

i spoke with tech support, and they said there isn't really a way to "dynamically" create an SFC. I took that as you cant import in an SFC through a script, but im pretty sure you can develop a script to create an XML to manually import....

---

<div class="post-metadata">

**Author:** ![vigneshwaranp](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vigneshwaranp](https://forum.inductiveautomation.com/u/vigneshwaranp)\
**Post date:** [June 22, 2023, 10:15am UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/5 "2023-06-22T10:15:23Z")

</div>

thanks for sharing the update.  
yeah through a script i can automate and create the xml and place in the location for where the SFC stays, but if you see the SFC's xml file that it creates, it uses a unique id for each of the nodes/blocks/elements etc.. and i'm not sure if we can generate ourselves those unique ids and also if that is being stored somewhere else as well.

---

<div class="post-metadata">

**Author:** ![michael.edmonson](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@michael.edmonson](https://forum.inductiveautomation.com/u/michael.edmonson)\
**Post date:** [June 22, 2023, 2:53pm UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/6 "2023-06-22T14:53:16Z")

</div>

I've been using the uuid library..

import using:  
import uuid

generate id using:  
uuid.uuid4()

---

<div class="post-metadata">

**Author:** ![michael.edmonson](https://avatars.discourse-cdn.com/v4/letter/m/e9bcb4/32.png) [@michael.edmonson](https://forum.inductiveautomation.com/u/michael.edmonson)\
**Post date:** [June 22, 2023, 2:54pm UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/7 "2023-06-22T14:54:01Z")

</div>

when you place the xml file in the sfc folder, does it populate into the ignition designer automatically?

---

<div class="post-metadata">

**Author:** ![vigneshwaranp](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@vigneshwaranp](https://forum.inductiveautomation.com/u/vigneshwaranp)\
**Post date:** [June 22, 2023, 3:00pm UTC](https://forum.inductiveautomation.com/t/creating-designing-sfc-charts-through-scripts-dynamic/72388/8 "2023-06-22T15:00:12Z")

</div>

I have not tried yet, but if you haven't tried already try to reduce the project directory scan rate in ignition.conf, have a lower value to pick it up after you place the file

[Gateway Configuration File Reference - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/Gateway+Configuration+File+Reference#GatewayConfigurationFileReference-ProjectDirectoryScanRate)
