# Quick one pls - calling custom node from Python script

**URL:** <https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309>\
**Category:** Developers\
**Created:** [December 17, 2016, 5:43am UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309 "2016-12-17T05:43:43Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![blank13](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@blank13](https://forum.dynamobim.com/u/blank13)\
**Post date:** [December 17, 2016, 5:43am UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309/1 "2016-12-17T05:43:43Z")

</div>

Hi there,

I think this is a very simple one but have searched for quite a bit and cannot seem to find any mention of it online!

I am trying to call a Clockwork custom node (FamilyInstance.ByPointInView) from within a Python script node as I would like to loop it.

I thought it would be adding ‘import Clockwork’ or something like that - could some one help please?

Many thanks in advance.

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 17, 2016, 7:41am UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309/2 "2016-12-17T07:41:07Z")

</div>

Hello, I assume that you’ve already seen that:

> [@Calling Custom Nodes from Code Block or Python](https://forum.dynamobim.com/t/calling-custom-nodes-from-code-block-or-python/735/2):
>
> Calling custom nodes from Python used to be possible in 0.6.3 but hasn’t made a comeback yet. I agree, both features would be extremely useful.

---

<div class="post-metadata">

**Author:** ![blank13](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@blank13](https://forum.dynamobim.com/u/blank13)\
**Post date:** [December 17, 2016, 11:28am UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309/3 "2016-12-17T11:28:51Z")

</div>

Thanks - yes I have, though the responses were from 2 years ago so I was wondering if that is still the case now?

---

<div class="post-metadata">

**Author:** ![Yna\_Db](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/yna_db/32/30641_2.png) [@Yna\_Db](https://forum.dynamobim.com/u/Yna_Db)\
**Post date:** [December 17, 2016, 11:38am UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309/4 "2016-12-17T11:38:55Z")

</div>

I would suggest to address this question to someone proficient by using an @ address (I suppose that a personal message would be sent but I admit that never tried it myself)…

---

<div class="post-metadata">

**Author:** ![Andreas\_Dieckmann](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/andreas_dieckmann/32/365_2.png) [@Andreas\_Dieckmann](https://forum.dynamobim.com/u/Andreas_Dieckmann)\
**Post date:** [December 17, 2016, 12:12pm UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309/5 "2016-12-17T12:12:25Z")

</div>

Nothing’s changed

---

<div class="post-metadata">

**Author:** ![Gui\_Talarico](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/gui_talarico/32/10887_2.png) [@Gui\_Talarico](https://forum.dynamobim.com/u/Gui_Talarico)\
**Post date:** [December 17, 2016, 6:37pm UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309/6 "2016-12-17T18:37:51Z")

</div>

@blank13  
while the answer to your question is **no** (_“can I call a custom node”_),  
the goal you are trying to achieve is possible (_“as I would like to loop it”_).

Obviously, you can _loop over it_ by feeding a list of points, but if you need to customize it (ie use different types as inputs, you can just use the code from the custom node, which is quite simple, as a function in your python code.  
Example below (not tested)

```
fam_instance_by_point(point, famtype, lvl):
    # From FamilyInstance.ByPointInView.dyf at
    # github.com/andydandy74/ClockworkForDynamo/            
    
    TransactionManager.Instance.EnsureInTransaction(doc)
    # make sure familysymbol is active
    if famtype.IsActive == False:
        famtype.Activate()
        doc.Regenerate()
    newobj = doc.Create.NewFamilyInstance(point.ToXyz(),famtype,lvl)
    TransactionManager.Instance.TransactionTaskDone()        
    return newobj.ToDSType(False)

created_instances = []
for point in points:
    element_instance = fam_instance_by_point(point, famtype, lvl)
    created_instances.append(element_instance)
```

---

<div class="post-metadata">

**Author:** ![blank13](https://avatars.discourse-cdn.com/v4/letter/b/51bf81/32.png) [@blank13](https://forum.dynamobim.com/u/blank13)\
**Post date:** [December 18, 2016, 1:17am UTC](https://forum.dynamobim.com/t/quick-one-pls-calling-custom-node-from-python-script/8309/7 "2016-12-18T01:17:03Z")

</div>

Thanks everyone. Thanks Gui I will look at doing that.
