Author Topic: coordinate problem sending command  (Read 2569 times)

0 Members and 1 Guest are viewing this topic.

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
coordinate problem sending command
« on: September 25, 2007, 01:26:28 PM »
This is my first post in the LISP area so be nice.

There is a bug in AutoCAD where when you plot limits you can get unwanted results.
It happens when you change dview. In my case it was when we used the 3DOrbit function and then reset the view using the "PLAN" command.
Anyway I am trying to write a quick fix for when it happens.
For some reason the second point passed using PlotFix causes an error.
Code: [Select]
(DEFUN C:PlotFix()
(setvar "CMDECHO" 1)
(command "DVIEW" "All" "" "Points" "0,0,0" "0,0,1" "")
)

I get this result:
[start]
Quote
Command: PLOTFIX
DVIEW
Select objects or <use DVIEWBLOCK>: All 1 found

Select objects or <use DVIEWBLOCK>:
Enter option
[CAmera/TArget/Distance/POints/PAn/Zoom/TWist/CLip/Hide/Off/Undo]: Points
Specify target point <1.0000, 1.0000, 1.0000>: 0,0,0
Specify camera point <1.0000, 1.0000, 2.0000>: 0,0,1
Camera and Target may not be coincident
; error: Function cancelled

Specify camera point <1.0000, 1.0000, 2.0000>:
[end]
Funny thing is if I enter 0,0,1 and press enter the points are set and all is OK.
I thought of setting system variables for the values but they are read only so I think I'm stuck with using "command".
Any help is appreciated.

<edit: tags added-CAB>
« Last Edit: September 25, 2007, 01:37:24 PM by CAB »
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

T.Willey

  • Needs a day job
  • Posts: 5251
Re: coordinate problem sending command
« Reply #1 on: September 25, 2007, 01:29:24 PM »
This seemed to work for me
Code: [Select]
(command "_.dview" "_all" "" "_points" '(0.0 0.0 0.0) '(0.0 0.0 1.0) "")
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: coordinate problem sending command
« Reply #2 on: September 25, 2007, 01:38:03 PM »
We're always nice.  8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

mohnston

  • Bull Frog
  • Posts: 305
  • CAD Programmer
Re: coordinate problem sending command
« Reply #3 on: September 25, 2007, 01:52:08 PM »
This seemed to work for me
Code: [Select]
(command "_.dview" "_all" "" "_points" '(0.0 0.0 0.0) '(0.0 0.0 1.0) "")
It works for me too. Thanks.

I thought of sending in points instead of strings but couldn't get it to work. Probably got the syntax wrong.
The frustrating part is if you send in "1,1,1" "1,1,2" AutoCAD doesn't complain. But "0,0,0" "0,0,1" breaks it.

Ok, now I've got to get out of the LISP area and back to .NET before I get cooties.

Thanks again for the help.
It's amazing what you can do when you don't know what you can't do.
CAD Programming Solutions

CADaver

  • Guest
Re: coordinate problem sending command
« Reply #4 on: September 25, 2007, 05:46:26 PM »
running osnap??

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: coordinate problem sending command
« Reply #5 on: September 25, 2007, 06:11:19 PM »
Those pesky little devils. :evil:

Test this:
Code: [Select]
(DEFUN C:PlotFix()
(setvar "CMDECHO" 1)
(command "DVIEW" "All" "" "Points" "_non" "0,0,0" "_non" "0,0,1" "")
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.