Jump to content

Create Symbol node


Recommended Posts

Hi everyone, I don't seem to be able to find a node that can create symbols. I did manage to find one that was written by domc, but it only creates a symbol in 3d space. Code is below.

 

Is there any way i can modify the configuration so that the objects being inserted go to 2d space, not 3d? I am trying to create a marionette program that creates symbols from groups - that have certain records. There has been other ones that have been done with creating symbol by object name (including groups) but it only works on single objects, groups do not show up in the 2d annotation space, thus disappearing

 

#DomC v001

@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
    By = 'DomC';import datetime; now = datetime.datetime.now(); y80f5 = now.year;m80f5 = now.month; d80f5 = now.day; h180f5 = now.hour; mi180f5 = now.minute; s180f5 = now.second; ms180f5 = now.microsecond; h280f5 = h180f5-12 if h180f5 >=13 else h180f5; VersionChange1 = str(y80f5)+' '+str(m80f5)+' '+str(d80f5); VersionChange2 = str(y80f5)+'-'+str(m80f5)+'-'+str(d80f5)+'-'+str(h280f5)+'-'+str(mi180f5);
    TextStatic = Marionette.OIPControl( By +' v'+VersionChange2, Marionette.WidgetType.TextStatic, "")
    this = Marionette.Node( "Create Symbol" )
    this.SetDescription( 'Creates a new Symbol' )
    
    h_obj =  Marionette.PortIn(vs.Handle(0))
    h_obj.SetDescription( "symbol content (one object) if empty, an empty 3D (3D Locus) symbol will be created" )
    
    s_name = Marionette.PortIn('Symbol-1')
    s_name.SetDescription( "the symbol name" )
    
    s_sym = Marionette.PortOut()
    s_sym.SetDescription( "the result symbol name" )
    
    h_sym = Marionette.PortOut()
    h_sym.SetDescription( "handle to the newly created symbol" )


def RunNode(self):
    obj = self.Params.h_obj.value
    name = self.Params.s_name.value
    vs.BeginSym(name)
    vs.Locus3D(0,0,0)
    h = vs.LNewObj()
    vs.EndSym()
    
    vs.Marionette_DisposeObj(h)
    
    h_sym = vs.GetObject(name)
        
    vs.SetParent(obj, h_sym)
    vs.ResetObject(obj)
    vs.ResetObject(h_sym)
    
    self.Params.s_sym.value = name
    self.Params.h_sym.value = h_sym

 

 

I think the problem lies with the create symbol node. See screenshots below. Seem like i just need a create symbol node with more properties, or just a 2d symbol node.

 

1. Design layer space

 

image.png.81231d045891ee61d106c597b8232204.png

 

3d view space

image.png.55b9937c5f1c7f3b0d2ce1242ea78be6.png

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...