Jump to content
Macro Express Forums

Cory

Members
  • Posts

    4,207
  • Joined

  • Last visited

  • Days Won

    61

Posts posted by Cory

  1. I used to be an expert at AutoCAD but I moved into IT about 20 years ago and I've not used it much since, so my information might be dated. 

    I put a link in my post. AutoLISP it the automation language in AutoCAD. It was structured to be syntactically like LISP not it's not LISP. AutoLISP exists only in AutoCAD and is akin to VBA for MS Office products. Back in my day and since the beginning of AutoCAD, AutoLISP was the most powerful automation tool in AutoCAD. I think it could do anything. I only wrote a few and had other employees write more complex programs, but it's a wonderful tool and does not use the GUI. It is however syntactically difficult for someone who has never programmed before. However if I had automation to do in AutoCAD and I had a choice to learn MEP or AutoLISP, I'd do AutoLISP. 

    But if you want to stick with MEP for other reasons, I'm sure it can do what you want. Like RBerg said, ASCII file process is your friend. I think you would start with you would have MEP type the AutoCAD Insert command. I Don't remember being able to specify attributes on insert thought, so I think you would have MEP enter the AutoCAD ATTEdit command with the "last" option for selection. But it's been awhile. 

    I do have AutoCAD still and MEP. I'm sure I can help you find a way. 

  2. I do use error logging. You shoudl be able to see from the logs which macro you have added the Log Errors command to that are reporting problems with your script. To be clear this sounds like a command you added to your macro doing what it's supposed to do. Check out the help section "Log Errors" for this command. 

    You could also export your macro to text and search for all occurrences of the command. I posted a macro here for that some time ago BTW. 

  3. In my experience it will only prompt you when your in a command edit dialog. Saving or other operations will not trigger a prompt. Mostly I've seen this when I copy parts of code from another macro, which is another reason why it's a good idea to create many small macros to act as functions or subroutines. Never write the same code twice. 

    But AFAIK, what you are experiencing is normal and there's no option that will cause the scripting editor to prompt you to declare variables when saving. 

  4. 2021-02-27_10-22-33.jpg.e3f1bd9641d8c5ddff5e26502858d446.jpg

    Note that you don't have to use parameters. 

    BTW Kevin's example on the support page illustrates that only a space shoudl be between the values. I know this is the same in .NET and other languages and programs.

    To be clear, if your value was 9 and you used that comma the JScript would receive a parameter "9," (numeral nine and a comma) which can only be used as text. I'm guessing what you did using the Number() function was to create an invalid cast exception. I don't have time to research it now, but what you saw returned "-1.#IND" is an exception code. I found this article for IEEE codes in C++ which look similar. I didn't read it, but it might be a clue for you here. 

    You should use exception handling in your scripts and macros to avoid exceptions. 

    • Like 1
  5. I am speculating that you can't write to the console and get the value back. You need to use the Return function which terminates the script and writes the value to the console. That's what MEP reads in. 

    Post an example of a script. Make is super simple and make sure it only contains commands that are needed to demonstrate the problem. 

    • Like 1
  6. In general, you will be better off learning how to use the keyboard to do things in a web page and use TextType to automate. Each control, including links in a webpage should be a tab-stop. All my later macros before I started writing programs were all based on the number of tabs it takes to get to any control in a web page. I have written hundreds of macros to automate web pages and found the overall effort and lines of code about 10% of that trying to use the mouse. Mouse moves is the road less travelled. And, BTW, that means it's the one you don't want to take 🙂

    List boxes you can tab to them then arrow down or start typing to highlight an item.

    Do yourself a favor and look up a list of keyboard shortcuts available for your browser and try to use them first. 

    • Like 2
×
×
  • Create New...