Jump to content

MeTheMachine

Member
  • Posts

    61
  • Joined

  • Last visited

Posts posted by MeTheMachine

  1.  


    Based on an earlier script/post about selecting lighting objects by universe... http://[https://forum.vectorworks.net/index.php?/topic/102718-selecting-lighting-objects-by-universe/#comment-449004]

     

    Is it possible to select lighting device by a range of channel numbers? For instance 101-103

    Using the script from before, how would I loop through and parse the dialog a user enters.

     

    import vs
    vs.DSelectAll()
    channelRange = vs.IntDialog("Enter a fixture number range", 1)
    vs.SelectObj("INSYMBOL & INVIEWPORT & ('Lighting Device'.'Channel'='{}')".format(channelRange))


    Any guidance would be appreciated..

  2. Using "Custom Selection..", I can create the following python script

     

    import vs;
    vs.DSelectAll(); vs.SelectObj("INSYMBOL & INVIEWPORT & ('Lighting Device'.'Universe'='1')");

     

    Ultimately, I would like to not have "Universe" hard coded and have the ability to use a PopUp and enter a value for Universe.

     

    Any of you python people willing to help me get something going....

  3. Anyone ever figure out a fix or workaround for this?  Yesterday, I did a Nuke and Pave on my mac.... rebuilt (not imported) all my VW preference settings, and I'm experiencing this same exact issue...

     

    Across different files and after VW restarts.

     

     

  4. First, I'm not the greatest working in 3D, so I have a questions: Is this a bug or me?

     

    When I have a truss selected, adjusting its length from the handle will also rotate it... 

     

    I noticed that when I uncheck "Show 3D Detail", the problem doesn't occur.

     

    I've added a GIF to show, I'm sorry about the resolution... 

     

    You can see, that:

    - first I shorten the truss

    - it rotates.

    - I undo

    - Check off "Show 3D Detail"

    - Adjust and its fine.

     

    Adjusting Working Plane, Holding Shift, etc doesn't fix the issue.

     

    So, is this a bug or me...

    CleanShot 2021-05-13 at 10.22.30.gif

  5. I'm drawing over a PDF, but when I zoom in close, the PDF disappears.  When I zoom out, it will refresh and appear.  Is there anything I can do to mitigate this?

     

    Using 2 layers, one with the PDF and the other for drawing.  The layers are the same scale.  I've also tried adjusting the 3 Navigation Graphics settings, but nothing is helping....

     

    You can see in the GIF, that my red area is where I'm drawing the initial footprint....

     

    Any suggestions...

     

     

     

     

    971384111_CleanShot2021-05-11at15_44_15.thumb.gif.0f14f0e8528a1aec3d6eaf6f847a4eaa.gif

     

  6. I remember having a similar issue with PyCharm and changing "pip install ..." to "pip3 install..."  fixed my issue, even though I set the alias of pip = pip3...

     

    I'm far from a programmer and this probably wont do anything, but felt it might be worth mentioning.

  7. I do a lot of tracing over PDFs for lighting plots.  Often, the set designer will draw walls that don't conform to the standard wall tool... or at least with my level of experience. 

     

    This isn't a complex wall, but it was easy to explain my question. As you can see in the image:

    # 1 -  Starts with a wall 4", which is a standard width for a set wall.

    # 2 - Jumps to a larger width.

    # 3 - Adds a little over hang.

     

    Typically, I would draw the 4" wall and stop when it changes its size. Then create a new wall with whatever the new size would be, and then just join them.  This gets annoying with more complex sets.

     

    Is there a simpler way to do this?  Using the standard "Create Walls from ...' has produced undesired results.

     

    Any suggestions would be great.

     

    image.thumb.png.6b7d9da40d9d5268ce3e8534b988ab2a.png

  8. 13 hours ago, Pat Stanford said:

    The following AppleScript gets the full path of the frontmost VW file onto the clipboard.

     

    There is probably a more elegant way to do this using python, but I am not enough of a python expert to make it happen. At least I figures some way to get the contents of a variable out of VW and into a form that can be used in the rest of the AppleScript.

     

    You can't copy a Text object in VW and paste it into a different application. So I Edit the text block, Select All, and copy that. That can be pasted into a different application.

     

    In the version of VW I am running I get a Beta Undo Error if I don't use the UndoOff command at the top. Undo will (should) automatically restart when the procedure ends.

     

    And since there are no variables in the VectorScript, you could actually delete the Procedure, Begin, End, and Run lines.

     

    HTH

     

    
    tell application "Vectorworks 2021"
    	run VectorScript "
    	
    	Procedure Test;
    	
    	Begin
    		UndoOff;
    		CreateText(GetFPathName);
    		Redraw;
    		EditObjectSpecial(LNewObj,0);
    		DoMenuTextByName('Select All',0);
    		DoMenuTextByName('Copy',0);
    		SetTool(-240);
    		DelObject(LNewObj);
    	End;
    	
    	Run(Test);"
    	
    end tell
    set PTS to get the clipboard

     

     

     

    Thank you very much, Pat!

  9. 3 minutes ago, michaelk said:

    In AppleScript isn't there a difference between "native" file path and "unix" file path?  I think POSIX does the non unix flavor.  But this is at the limits of my AppleScript experience 🙂 

     

    Its entirely possible...

     

    I was looking at other AppleScripts examples and they were using POSIX path...

     

    Applescript makes my head hurt...

  10. I'm trying to use a program on the Mac called Hook

     

    My goal is to link or "hook" all the PDF files I use for a drawing to the vectorworks file I'm working in. Currently, I can have 12 different sets, which is 12 different vectorworks files, and all of them have up to a dozen PDF files from Art Dept.   So if I'm working on "Haunted Castle.vwx", when I invoke Hook, it will pull up all the PDFs I have linked to "Haunted Castle.vwx" file.

     

    With that in mind, I'm probably going about this all wrong. 

     

    I wrote a python script that I use to capture the filepath and set it to my clipboard.

     

    Keep in mind, Im not a programmer but it works...

    import subprocess
    
    def Path():
        
        filePath = vs.GetFPathName()
        filePath = filePath[1:]
        subprocess.run("pbcopy", universal_newlines=True, input=filePath)
        vs.AlrtDialog(filePath)
    
    Path()

     

    Following the instructions for creating integration scripts

     

    Once I run the python script, in vectorworks, I use this applescript to create the hook path

    -- Append clipboard to Hook Link
    set cp to POSIX path of clipboard
    
    -- Get Address
    set hookPath to "file://" & (the clipboard)

    And I use this applescript to create the name of the hook... using the name of the document

    tell application "Vectorworks 2021"
    	set current_name to name of item 1 in windows
    end tell

     

    ---

    I tried to use the "Run python script" in Applescript but kept getting an error.  I'm sure its something I'm doing wrong.

     

    I didn't know if it was possible to just get the filePath of the document in applescript?  It would take the manual execution of the python script, out of the mix...

     

    I've hit my afternoon lull, so I hope this makes sense. 

     

     

     

  11. Seems like something got wonky with my conversion from auto hybrid to normal (for lack of a better word) symbol. 

    Looking into the 3D components, there was also a symbol within a symbol. 

     

    Fixing this, seems to have fixed my problem.

     

    Thanks for the help, markdd.

  12. 7 minutes ago, markdd said:

    If you share the fire or the selection of lighting devices here or as a PM then I could take a look...

    I'll have you ask the original file owner...

     

    So I did notice that editing the 2D components had the same symbol within itself. I fixed that so now its only offsetting by 2 and not 3....  Is it possible its selecting the 2D and 3D objects?  I would assume it would indicate 6 objects selected in the OIP and not the 3, which is expected.

  13. No...

     

    That being said, I'm pretty certain it is in the symbol itself.   The symbol was originally an auto-hybrid, however I tried to convert it to non auto-hybrid by copying ungrouping everything and copying the 2D and 3D parts..

     

    Perhaps something went strange

  14. I'm having an issue with numbering instruments in spotlight.  For whatever reason, the lights do not properly increment from fixture to fixture.  This has happened in multiple files, so perhaps its the symbol or maybe its a bug?  

     

    Regardless, I'll include a video to show whats happening. 

     

    You'll see that I set the channel to increment by 1 and the dmx address to increment by its footprint, which is 17.... 

     

     

  15. I'm experiencing a behavior that I haven't seen before.  VW has created a class called "Symbol Name-..." and will not let me change the class for the symbol.  It seems to be related to the specific document, when I create a new document and import the symbol, I can change the class freely. 

     

    Any thoughts? 

     

    nWTCP7+

     

  16. So I got this working... Thought I would share my steps.  

     

    • First, I created a folder called "Python Modules" and set it as a path in VW script options.
    • I downloaded and copied Pydevd to the Python Modules Folder. 
    • Per, PyCharm instructions, I got the "pycharm-debug-py3k.egg" and copied it to the modules file, also.  
    • I created a PycharmDebug.py file that imports sys and appends the egg file to the path.

    In the script I want to debug, I add the following:

      import PycharmDebug  
      import pydevd
       
      pydevd.settrace('localhost', port=1090, stdoutToServer=True, stderrToServer=True)

     

    With that in mind, I'm almost certain I made some unnecessary/extra steps.  Any suggestions or thoughts would be helpful.

     

     

     

    • Like 2
×
×
  • Create New...