Jump to content

Jayme McColgan

Member
  • Posts

    196
  • Joined

  • Last visited

Posts posted by Jayme McColgan

  1. so I'm working on a plugin that creates a symbol and then rotates it based on a degree making a consistent curve. i've gotten a version working but only if i know the diameter of the circle the curve is based on... my question is if the user puts in a angle of 6 how do i dynamically find where to rotate the symbol from? 

     

    heres a code used to make what I'm looking for. this picture is based off already knowing the size of the circle... i've also attached a picture of what I'm trying to achieve. 

     

     

    tile = "Symbol-1"
    cur_width = 0
    cur_angle = 10
    vs.DSelectAll()
    
    for i in range(10):
    	vs.Symbol(tile, -9.842519685, 1.289, 0)
    	last = vs.LNewObj()
    	vs.RotatePoint(0, 109.921, cur_angle)
    	vs.Move3DObj(last, 0, 0, 0)
    
    	cur_width = cur_width + 19.68503937
    	cur_angle = cur_angle + 10
    	vs.DSelectAll()

     

    Screen Shot 2021-08-03 at 10.30.04 PM.png

  2. hey guys,

     

    so I'm having some trouble assigning a texture to a 3d polygon thats being created in a PIO... ive got color working using vs.SetFillBack but i can't figure out what to use to apply a texture to the surface... 

     

     

    ANWSER:

    ### Tiles
    wide = 5
    tall = 6
    ### Tile PHY Size
    ledsize = 24
    
    ### Texture Name
    ledtext = "Texture-1"
    
    ### Build Extrudged Rectangle
    vs.BeginXtrd(0, 1)
    vs.RectangleN (0, 0, 1, 0, (wide*ledsize), (tall*ledsize) )
    vs.EndXtrd()
    
    ### Assign Texture to extrude
    last = vs.LNewObj()
    vs.SetTextureRefN(last, ledtext, 4, 0)

     

  3. thanks! this helped me a lot! I'm almost successfully made my first PIO with parameters! 

     

    the only real issue i have right now is when i insert it from the tool set, i get a "HANDLE Variable is NIL"... I'm using vs.FSActLayer() but obviously thats not what i should be using... any advice with what i should be using to get the handle of the PIO would be great. 

  4. hey guys,

     

    a few questions on understanding how plugin objects work...

    so i've made a plugin (via the plugin manager) and I'm trying to understand how to interact with it.

     

    - when i insert a plugin object from the tool set does it run the whole script?

     

    ANWSER:

    yes when you insert a PIO it runs the whole script based on how you have it laid out

     

    - if i have made parameters for my plugin object, does it run the whole script if i change any of the values? 

     

    ANWSER:

    Yes, when you update a field parameters it reruns the whole script

     

    - how do i actually get the value of the parameters after changing them? i've tried vs.GetObjectVariableHandle (and the various version of that) and doesn't seem to be working.

     

    ANWSER:

    def collect():
        	### Get PIO Info
            PIO_handle = vs.GetCustomObjectInfo()[2]
            recordHandle = vs.GetParametricRecord(PIO_handle)
            recname = vs.GetName(recordHandle)
    
    		### Pop Up Field
            product = str(vs.GetRField(PIO_handle, recname, "Drop down choices"))
    		### Interger Field
            how_wide = int(vs.GetRField(PIO_handle, recname, "Tiles Wide"))
    		### Dimension Scientific notation to inches
    		stupid = vs.GetRField(PIO_handle, recname, "Length of object")
        	dem_length = vs.ValidNumStr(stupid)[1]
            
            return(product, how_wide, dem_length, PIO_handle, recname)

     

  5. ok so i have a few more questions about some things i can't find. 

     

    what should i be using to set the Z height of a symbol?

    UPDATE: solved this. 

    vs.Symbol(symbolName, x,y , -22.5)
    last = vs.LNewObj()
    vs.Move3DObj(last, 0, 0, 180)

    what should i be using to get the symbol type?   the name that is just below class and layer. (normally its polyline, focus point, 2d/3d object, ect.)

    can i inset a symbol from a drawing thats in my favorites folder? 

     

    this one is more of a general python question but i need to find the length of the side of a 90º triangle only knowing the length of 1 side and 2 of the angles. ive tried what i though was correct but doesn't seem to come up with the right answer... ive attached a picture and the code i tried for reference. in the image I'm trying to find the length of the A side.

     

    import math
    
    angle_a = 22.5
    b = 56
    a = b * math.tan(angle_a)

     

    Screen Shot 2021-05-30 at 8.50.50 PM.png

  6. so i've been using Vectorworks for a few years and decided to make some python scripts. i understand python but i've having a hard time getting off the ground. i've made some basic scripts but I'm ready to start making useable ones now...

     

    what i want to do is to select some objects and get some basic info about them (location, size, ect.) and add some symbols based off the positions of the selected items. I'm stuck on step one of looping through the selected objects.

     

    any help would be appreciated.  

     

     

    Solution:

     

    OBJECTS = []
    
    def start():
    	vs.ForEachObject(collect, '((VSEL=TRUE))')
    
    def collect(handle):
          	### Get Selected PIO Record name
            hrecdef = vs.GetParametricRecord(handle)
            recname = vs.GetName(hrecdef)
            
            if recname == "Focus Point Object":
                fpoint_info = []
                fpoint_x, fpoint_y, fpoint_z = vs.GetSymLoc3D(handle)
                fpoint_rot = vs.GetSymRot(handle)
                fpoint_info.append(handle)
                fpoint_info.append(fpoint_x)
                fpoint_info.append(fpoint_y)
                fpoint_info.append(fpoint_z)
                fpoint_info.append(fpoint_rot)
    
                OBJECTS.append(fpoint_info)

     

  7. hey guys,

     

    so i just got my hands on a 2013 Mac Pro(12-Core Intel Xeon, 2 FirePro D700 6 GB, and 64gb of ram) and my 2018 baseline macbook pro seems to out perform it... is there anyone still using a 2013 mac pro. Has VW just moved past hardware from 2013? i can never remember what part of the system VW uses the most. Does it help that the mac pro has 2 graphics cards? does the 12 core Xeon help or hurt it? does VW2020 prefer clock speed over core count? 

     

    my main workflow is Spotlight and occasionally OpenGL/renderworks.

     

    thanks guys. 

  8. Hey guys so I'm currently updating all my custom fixture symbols for 2020. Is it possible to assign a Default Fixture Profile? Ive tried adding the Fixture mode to the Light info record and that didn't work. 

     

    any ideas? 

×
×
  • Create New...