Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't Get MOVE to Work in Script

8 REPLIES 8
Reply
Message 1 of 9
dreno99
671 Views, 8 Replies

Can't Get MOVE to Work in Script

Hey,

 

I am using the following line in a script file in my AutoCAD 2013: 

 

MOVE all  .356,.425 .435,.435

 

It has a return at the end to the next line of the script.

 

when I run it, AutoCAD reports this: 

 


Command: MOVE
Select objects: all 212 found
2 were not in current space.

Select objects:
Specify base point or [Displacement] <Displacement>: .356,.425
Specify second point or <use first point as displacement>: .435,.435

 

But when I query the object that is supposed to be at 0.435,0.435 it remains at 0.356,0.425. In other words, nothing is moving. I have a SAVE at the end of the script. It doesn't matter whether I run it in a batch, or call it up in the drawing session, it just doesn't want to MOVE anything.

 

any ideas where I went wrong?

 

Thanks.

8 REPLIES 8
Message 2 of 9
hmsilva
in reply to: dreno99

works for me...

 

_.move
all

 

.356,.425
.435,.435
_.qsave

 

HTH

Henrique

EESignature

Message 3 of 9
dreno99
in reply to: hmsilva

thanks! I will give it a shot.

Message 4 of 9
hmsilva
in reply to: dreno99

You're welcome, dreno99

 

Try the attached file

 

Henrique

EESignature

Message 5 of 9
dreno99
in reply to: dreno99

Rats. It won't work. Some files work, but not the majority. Nothing is frozen. When I run the script in batch I can see the objects all highlight for a split second, but they don't move. I can't see any reason why they shouldn't. I guess I should be glad of job security - I have a couple hundred of these to get through. At least the other lines of the script are working.

 

Command: _.move

Select objects: all
188 found
2 were not in current space.

Select objects:

Specify base point or [Displacement] <Displacement>: .356,.425

Specify second point or <use first point as displacement>: .435,.435

 

But nothing moves!

Message 6 of 9
hmsilva
in reply to: dreno99

try adding at the top

 

OSMODE

0

_.move

 

Henrique

EESignature

Message 7 of 9
dreno99
in reply to: hmsilva

Hey, I think OSMODE to 0 works. Why, I do not know. I should set it back to 63 at the end of the script, which is where I usually have it, right?

Message 8 of 9
hmsilva
in reply to: dreno99


@dreno99 wrote:

Hey, I think OSMODE to 0 works. Why, I do not know. I should set it back to 63 at the end of the script, which is where I usually have it, right?


You can set the OSMODE back to 63, after the move command ends...

 

Henrique

EESignature

Message 9 of 9
Kent1Cooper
in reply to: dreno99


@dreno99 wrote:

Hey, I think OSMODE to 0 works. Why, I do not know. I should set it back to 63 at the end of the script, which is where I usually have it, right?


An alternative approach [which actually uses less code than setting OSMODE to 0 and then back again afterwards], when you're only dealing with a couple of points, is to disable Osnap momentarily for each:

 

MOVE all  none .356,.425 none .435,.435

 

That has the further advantage that if you have an Osnap combination different from your usual for some legitimate reason, it will leave that as you have it.

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost