Code Red > AutoLISP (Vanilla / Visual)

coordinate problem sending command

(1/2) > >>

mohnston:
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: ---(DEFUN C:PlotFix()
(setvar "CMDECHO" 1)
(command "DVIEW" "All" "" "Points" "0,0,0" "0,0,1" "")
)
--- End code ---

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 quote ---
[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>

T.Willey:
This seemed to work for me

--- Code: ---(command "_.dview" "_all" "" "_points" '(0.0 0.0 0.0) '(0.0 0.0 1.0) "")
--- End code ---

CAB:
We're always nice.  8-)

mohnston:

--- Quote from: T.Willey on September 25, 2007, 01:29:24 PM ---This seemed to work for me

--- Code: ---(command "_.dview" "_all" "" "_points" '(0.0 0.0 0.0) '(0.0 0.0 1.0) "")
--- End code ---

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

CADaver:
running osnap??

Navigation

[0] Message Index

[#] Next page

Go to full version