Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Insert block from other file... with python script

$
0
0

i’m trying to make python script…
but i really don’t know how to make it right.

here is my script

import Rhino
import rhinoscriptsyntax as rs

def InsertFile():
# insert options
file = chr(34) + r"my file location" + chr(34)
point = rs.GetPoint(“Block base point”)
scale = 1.0
rotation = 0.0

# command
cmd = "_-Insert _File=Yes _LinkMode=_Embedded {} ".format(file)
cmd += "Objects _Enter {0}".format(point)
rc = rs.Command(cmd, False)

rs.UnselectAllObjects()

InsertFile()

i want to bring blocks from other file, and want to pick the block’s point

and if it is possible i want to set default setting ‘# command’ parts

# command
cmd = "_-Insert _File=Yes _LinkMode=_Embedded {} ".format(file)
cmd += "Objects _Enter {0}".format(point)
rc = rs.Command(cmd, False)

over here. i don’t want to choose any options.

my English is short… please help me :frowning:

4 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles