Page 44 of 64 FirstFirst ... 3440414243444546474854 ... LastLast
Results 431 to 440 of 636

Thread: The LSX tutorials thread!

  1. #431
    Join Date
    Feb 2007
    Location
    Fort Mill, SC USA
    Posts
    1,513

    Default

    Quote Originally Posted by SaltyRobot View Post
    It appears this is visual basic syntax. I was able to program an "if then else" statement as well as use the "modulus" function to make some segmented circles. This is so much easier than drawing color into the picture. I have also been able to blank segments of a circle using the same idea as below just using the blank command rather than color command. There is alot of potential here for quickly allocating part numbers or color to certain segments or points of a pattern. I am also wondering if you can load an existing Pic file and change the part number or color then re-save the file under a new name. This will be tested soon.
    This is like finding an Easter Egg, only much cooler (and much more practical). Although QuickPicEdit allows you to set the repeats for a selection of points, neither Quickpic or PicEdit allows you to adjust part numbers except manually for each point which can be time consuming. Scripting a solution would be a most awesome automated application of such attributes.

    Keep us posted of what you find!

    -David
    "Help, help, I'm being repressed!"

  2. #432
    Join Date
    May 2013
    Location
    Fort Mill, SC
    Posts
    556

    Default

    Quote Originally Posted by dkumpula View Post
    This is like finding an Easter Egg, only much cooler (and much more practical). Although QuickPicEdit allows you to set the repeats for a selection of points, neither Quickpic or PicEdit allows you to adjust part numbers except manually for each point which can be time consuming. Scripting a solution would be a most awesome automated application of such attributes.

    Keep us posted of what you find!

    -David
    Here is what I have come up with so far. The answer is YES! you can load a Pic file and modify the part numbers (or really anything for that matter) throughout the frame. However I am not sure I know enough VB to make a one size fits all solution to pick which points to change the part number and which to leave alone. It might be easy it might not. I am a hack at VB and only get by. The solution below is what I had time to work on today. Every 10 points it toggles between part number 1 and part number 0. I added comments to the code to help myself down the road and maybe help others develop a more sophisticated solution to what you are asking for. Its a learning process and its a starting place.

    As for scripting as a whole. This is a real game changer. I was able to create 10 circle with different colored segments in under 2 minutes. This is proving to be a worth while endeavor to investigate. My next goal is for the next scripts to make hot points in an existing Pic, create a Pic with hot point and connected lines, and create a Pic with just hot point. Will probably start with just some line segments and move up from there.

    Here is the code for adding part numbers:

    Code:
    'Loads a Pic File
    Pic.LoadFromFile("C:\Users\Public\Documents\Global LSX Files\Pic Files\My_PIC_Files\circle_009.pic")
    
    'Sets n equal to the number of points in the loaded Pic file
    n = Pic.N
    
    'Run a for loop to perform some action on the loaded Pic
    for i = 1 to n
    
    'The action performed by this code sets part # = 1 for ten points then part # = 0 for ten points
    'This will continue until the last point of the Pic file
    'Edit this code to change how often the part number changes in the Pic file loaded
    segment = i/10
    segment_action = segment mod 2
    
    if segment_action = 1 then
       Pic.Part i,1
    else
       Pic.Part i,0
    end if
    
    next
    
    'Unknown what this action does but appears to be required no matter what script is being run
    SET objShell = CREATEOBJECT("WScript.Shell")
    
    'Save the changes to a new file name in the same folder as the original file.
    Pic.SaveToFile("C:\Users\Public\Documents\Global LSX Files\Pic Files\My_PIC_Files\circle_010.pic")
    Watching Lasers Since 1981

  3. #433
    Join Date
    Feb 2007
    Location
    Fort Mill, SC USA
    Posts
    1,513

    Default

    Awesome stuff, Salty!

    As you learn more you should add a section into the LSX living manual that dzodzo and cmb wrote (with contributions from Swamidog and others). It's located here: LSXLivingManual.pdf

    And just a quick note for those LSX users who aren't familiar with the LSX living manual. This is an awesome supplement to the documentation provided with LSX itself, including a more detailed explanation of the basics as well as more advanced discussions like equations and code examples. The later can help those LSX users who are a bit rusty with trig, algebra, and/or coding a bit of a refresher. (As always, math is NOT required to do cool things with LSX, just a very powerful option for those that are inclined.)

    -David
    "Help, help, I'm being repressed!"

  4. #434
    Join Date
    May 2013
    Location
    Fort Mill, SC
    Posts
    556

    Default

    Here is another script to test:


    Code:
    'This script will draw a line of hot points along the x-axis
    
    Hot_Points = 10  'Edit this to change amount of hot point
    Clone_Points = 4 'Edit this to change amount of clones per hot point
    distance_between_points = 1/(Hot_Points -1) 'Evenly distributes points.  As hot points go up space between the points goes down
    n = ((2+Clone_Points) * Hot_Points) - 1 'Calculates the number of points needed for the frame
    Pic.N = n
    
    'loop to draw the points  change x with y to draw in the vertical plane
    for i = 1 to n
    
       action = (i - 1) mod (Clone_Points + 2)
      
       if action =  0 then
          Pic.Blank i,1
          Pic.Repeats i,6
       elseif action = (Clone_Points +1) then
          x = x + distance_between_points
          Pic.Blank i,1
          Pic.Repeats i,15   
       else
          Pic.Blank i,0
          Pic.Repeats i,15
    
    'Edit the color of the points here
          Pic.R i,0
          Pic.B i,255
          Pic.G i,0
       end if
    
       y = 0.5 ' centers the line in the middle of the screen
       Pic.X i,x
       Pic.Y i,y
    
    next
    
    SET objShell = CREATEOBJECT("WScript.Shell")
    
    Pic.SaveToFile("C:\Users\Public\Documents\Global LSX Files\Pic Files\My_PIC_Files\line_002.pic")
    Watching Lasers Since 1981

  5. #435
    Join Date
    Sep 2015
    Location
    Thessaloniki
    Posts
    223

    Default

    What is the latest version of LSX? I forgot my old email with which I got my LSX download link so I wouldn't know if a new version came out. Last time I updated was in 2013. Has there been a major update and how can I get the links? I( have the activation files and dongle.

  6. #436
    Join Date
    Jul 2008
    Location
    My momentum is too precisely determined :S
    Posts
    1,777

    Default

    There hasn't but a beta version is available (which is pretty stable it appears). The next version should include a lot of bug fixes.

    The LSX Beta Distribution Team should be with you shortly.

  7. #437
    Join Date
    Feb 2007
    Location
    Fort Mill, SC USA
    Posts
    1,513

    Default

    PM incoming, ghosttrain.
    "Help, help, I'm being repressed!"

  8. #438
    Join Date
    Dec 2010
    Location
    Wellington, New Zealand
    Posts
    39

    Default

    Excuse the noobie question, and i hope its in here. I'm just playing around with the 'easyshows' provided, and trying to figure out why the audio is stopping at the 30 second mark, can anyone help based on this screenshot ?

    http://iforce.co.nz/i/zwghmuqd.yxb.png

  9. #439
    Join Date
    Jul 2008
    Location
    My momentum is too precisely determined :S
    Posts
    1,777

    Default

    The audio is clipped for copyright reasons. You are supposed to source the files yourself.

  10. #440
    Join Date
    Dec 2010
    Location
    Wellington, New Zealand
    Posts
    39

    Default

    Right that makes a lot more sense! Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •