Jump to content

_change command issue


Recommended Posts

Hello everyone,

 

Im trying to make an autolisp routine by running a scr file to change text in several drawings. Im using the _change command but at the momment the new value is entered, it recognizes it as a command and not as a value, showing the "unknown command" error, have anyone had this issue?

 

Attached are the SCR files and the DRW template I want to modify

 

Thank you

example.dwg

test1.SCR

Link to comment
Share on other sites

does this give a clue?

 

Command: _CHANGE

Select objects: W

Specify first corner: 14.86,1.49

Specify opposite corner: 13.51,1.57

0 found

Select objects:

 

I don't think your window is picking up text and therefore not finishing the _CHANGE command.

 

On a slight aside, I used to prefer using a crossing window rather than a window as I found it more likely to pick up text.

Link to comment
Share on other sites

Make sure all osnaps are turned off. When you are running a script autocad will still snap to osnaps (depending on your zoom level), and your details are close together in the sample. It took me forever to figure out why sometimes a script would fail, till I figured that one out. If it still gives problems, then run the script again, press F2 to get the command history and copy that into a text file and post it here.

Link to comment
Share on other sites

Make sure all osnaps are turned off.

 

try this:

 

_CHANGE
w
[color="red"]_non[/color]
14.25,.28
[color="red"]_non[/color]
14.03,.44


Link to comment
Share on other sites

Batched your routine on your sample drawing which we had made copies of and it worked fine. The only thing missing was the line Qsave to save the changes.

 

I would agree with dbroada about using a crossing window. If I am testing a routine and have problems I also like to draw a line with the same co-ordinates, this is something visual that I can check against. It is also a good idea to zoom into the area you are changing, sometimes AutoCAD picks the wrong points off screen.

 

To turn off the snap you can set Osmode to 0. If you wish you can use the getvar and setvar commands to reset the osmode command afterwards.

 

Patrick

http://www.multi-batch.com/

Link to comment
Share on other sites

  • 3 weeks later...

Thanks all for your repplies, the script worked by itself, sometimes I just need to press esc before running it, but now I want to make a lsp routine and the same error is going

 

What do you mean with crossed windows, Im new at Autocad so I would appreciate any explanation

 

Regards

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...