Skip to content

Instantly share code, notes, and snippets.

@MikeUdin
Last active September 25, 2016 08:54
Show Gist options
  • Save MikeUdin/9b803541157b614dc879436c11470aee to your computer and use it in GitHub Desktop.
Save MikeUdin/9b803541157b614dc879436c11470aee to your computer and use it in GitHub Desktop.
Place Selected Objects To Connect
import c4d
# Welcome to the world of Python
# Author: Mike Udin, http://mikeudin.net
# 2016
def main():
objs = doc.GetActiveObjects(1)
if not objs: return
doc.StartUndo()
con_obj = c4d.BaseObject(c4d.Oconnector)
con_obj.InsertBefore(objs[0])
doc.AddUndo(c4d.UNDOTYPE_NEW,con_obj)
for obj in objs:
doc.AddUndo(c4d.UNDOTYPE_CHANGE,obj)
obj.InsertUnder(con_obj)
doc.EndUndo()
c4d.EventAdd()
if __name__=='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment