Jump to content

Macro problem


dkeran

Recommended Posts

I created a macro to speed up a piping process. It has been working fine, though today it is coming back with a different interpretation for '_layer;Set'. Once 'set' is entered it is returning an option for 'setvar'. I am using many LISPS which may be changing system variables that I can't keep a track of. In this part of the macro I want to change the current layer to 0.

 

Would anybody be able to help in pointing me in the direction of what system variable may have changed to have caused this, or possibly edit the macro to enable this process another way? The entire macro is below.

 

Thanks for any help in advance.

 

^C^C_Laymcur;\_circle;\d;0.125;_sweep;\;mo;so;\_move;\;0,0,0;0,0,-.0625;_layer;Set;0;;

Link to comment
Share on other sites

  • Replies 22
  • Created
  • Last Reply

Top Posters In This Topic

  • dkeran

    9

  • steven-g

    6

  • ReMark

    5

  • eldon

    1

Top Posters In This Topic

Can you post a copy of the command history, so we can see what happens at each step of the macro, but one point might well be with the 'move' command it appears as though you have an extra space in there, but that could be just a copy/paste error in your post

Link to comment
Share on other sites

Steven-G, command history below. I've managed to get around it for now swapping out ';_layer;Set;0;; ' for '_clayer;0;;;^C^C', though I wouldn't be happy to leave it at that without knowing the issue behind it. The space in the move command is, as you say, just a copy and paste issue.

 

Command: _Laymcur

Select object whose layer will become current:

0 is now the current layer.

Command: _circle

Specify center point for circle or [3P/2P/Ttr (tan tan radius)]:

Specify radius of circle or [Diameter]: d

Specify diameter of circle: 0.125

Command: _sweep

Current wire frame density: ISOLINES=4, Closed profiles creation mode = Solid

Select objects to sweep or [MOde]: 1 found

Select objects to sweep or [MOde]:

mo

Closed profiles creation mode [sOlid/SUrface] : so

Select sweep path or [Alignment/Base point/Scale/Twist]:

Command: _move

Select objects: 1 found

Select objects:

Specify base point or [Displacement] : 0,0,0

Specify second point or : 0,0,-.0625

Command: _layer

Command: Set

SETVAR Enter variable name or [?]: 0

Unknown variable name. Type SETVAR ? for a list of variables.

Command:

SETVAR

Enter variable name or [?]: *Cancel*

Link to comment
Share on other sites

Strange that the command line isn't giving you the prompt for the options after the _layer command is issued, I can understand that it then goes on and translates 'Set' as a shortcut for the setvar command but why would it ignore the _layer command. OK just a thought what is the value of 'filedia' and just try changing it to 1 or 0 see if that solves the issue (and change it back if it doesn't.

Link to comment
Share on other sites

Just tried that Stephen, no luck. Filedia was set to 1, changed to 0, tried the macro and same issue. It's odd alright. And I can't remember which LISPs I was using that may have changed a variable, especially one that wouldn't have changed it back.

Link to comment
Share on other sites

I can get the macro to go to the setvar command, but only by adding a second ';' after the '_layer' command in the macro, just check your macro carefully again that there are no errors in there (I doubt it, but I can't think of anything else)? what happens if you shorten the macro to

^C^C_Laymcur;\_circle;\d;0.125;_sweep;\;mo;so;\_move;\;0,0,0;0,0,-.0625;_layer;

does the layer command start then.

Link to comment
Share on other sites

OK grasping at straws here does this work

^C^C_Laymcur;\_circle;\d;0.125;_sweep;\;mo;so;\_move;\;0,0,0;0,0,-.0625;.layer;Set;0;;

note the period '.' in front of the layer command

Link to comment
Share on other sites

Neither of them seem to work Stephen. The first suggestion works and enters into layers. The second gives the same responce as the original. Sure not to worry, I've got it working through using '_clayer;0;;;^C^C' so not the end of the world. Thanks very much for the help though, much appreciated.

Link to comment
Share on other sites

The _layer;Set works fine for me, but then I am in Belgium, though as far as I know we use the normal English version of the program anyway. But either versiojn works when used in a macro (at least it does here), it could possibly cause issues on the OP's system.

Link to comment
Share on other sites

In the course of troubleshooting the problem did you close AutoCAD entirely then reopen it?

 

Did you use any custom lisp routines prior to trying to execute the macro?

Link to comment
Share on other sites

Mark, I tried the standard IT turn it off and on again, no good. I up to about 12 LISPs in any one day so can't keep a track of what I used most recently. I shouldnt have a LISP which changes and variable and not change it back though.

Link to comment
Share on other sites

No, you shouldn't but sometimes in our haste to solve one problem we inadvertently create another.

 

Are these lisp routines you have used in the past on a daily basis?

Link to comment
Share on other sites

I'd use them daily, could have used 10/12 of them before I noticed the macro issue. Though I've used all these functions for the previous few weeks with no issues.

Link to comment
Share on other sites

Very odd I'm at a loss, only thing I would suggest is go back to the shortened macro in post 6, and just keep adding to it one letter and character at a time and see where it breaks down again, that might give a clue. Or working backwards does

^C^C_layer;Set;0;;

work

Link to comment
Share on other sites

Morning folks, I've another issue I've just discovered which may be linked to the macro issue.

 

The process of copy and paste with base point, open an xref, etc that I have working from right clicking, their process is messed up a bit. I select information I want to copy, right click, select copy with basepoint, enter basepoint co ords, then it asks me again to select objects. After I select the objects again it does copy them and pasting isn't a problem. Though it is the same with opening an xref, when I select the xref, right click, open xref, it again asks me to select the xref.

 

Would anyone know if this is a variable problem? I've had this is the past but didn't link it to the macro issue. My solution in the past was to reset my AutoCAD to original settings which was a nuisane.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...