585,687 active members*
4,700 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > BobCad-Cam > Scripts for your everyday needs!
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2005
    Posts
    859

    Scripts for your everyday needs!

    Jon,

    Did you try this script out? It is for blanking the current layer. Simply add a menu item and keyboard shortcut to get it to work like you were wanting. One thing I like is having features I wasn't even told about.


    unselectall
    Attributes Output, Layer = currentLayer
    CADLayer
    XSelect Layers = currentlayer
    Attributes Layer = currentLayer, Blank=TRUE

  2. #2
    Join Date
    Oct 2005
    Posts
    859
    Post you script request (V20) and I will try to help. I don't have unlimited time but on simple things I can usually get it pretty quick. I am willing to help you on more complicated scripts but if I have to spend hours to write one then I could do it for a small fee.

  3. #3
    Join Date
    Feb 2006
    Posts
    4

    Question Function Library

    I am new to this stuff. I am trying to write a script and see the logic of using functions. I saw somewhere that you can put these functions into a function library. I created a file called funclib.bas. I have been unsuccessfull in calling it from my script. The function works if it is at the bottom of the script.
    What is the syntax?

    Thanks in advance

  4. #4
    Join Date
    Aug 2003
    Posts
    449
    First thing:
    Function function_name(ByVal txt as type of character that will be used) as returned type

    This is to set up the function in your other script. If you do not define the function it can not be used.

    Next thing:
    Declare Function function_name Lib "script_name(no bas)" (Byval txt as type of character that will be used) as returned type

    This is used where you are trying to call the function. You will have to declare the fuunction first.

    Then you can use the function like this:

    variable_name = function_name(variable_to_perform_function_on)

    Hope this makes some sense.

    Regards

  5. #5
    Join Date
    Feb 2006
    Posts
    4

    Exclamation Function Library

    Quote Originally Posted by The One
    First thing:
    Function function_name(ByVal txt as type of character that will be used) as returned type

    This is to set up the function in your other script. If you do not define the function it can not be used.

    Next thing:
    Declare Function function_name Lib "script_name(no bas)" (Byval txt as type of character that will be used) as returned type

    This is used where you are trying to call the function. You will have to declare the fuunction first.

    Then you can use the function like this:

    variable_name = function_name(variable_to_perform_function_on)

    Hope this makes some sense.

    Regards
    Thanks. That is a great explaination of a function call.
    I was looking to keep my functions available to any script by keeping it in a function library (a separate bas file). I finally succeeded. Here is the syntax:

    Declare Function Function_Name "Library_File_Name" (ByVal Var_Name As Var_Type) Var_Type_To_Return As Var_Type

    The library file name must be in the same folder as the calling file (and end in .bas which is not used in the call). I have not yet tried to place it in a different folder and try to use it. It needs to be surrounded by the double quotes marks. (" ") It is the available from any script in that folder.

    Thanks again and I hope this also makes sense.

Posting Permissions

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