Author Topic: Rotate3d routine quits without error msg  (Read 1213 times)

0 Members and 1 Guest are viewing this topic.

bemiller1

  • Guest
Rotate3d routine quits without error msg
« on: August 21, 2008, 02:08:10 PM »
I'm trying to write a bit of code that will be integrated into another (which tests out wonderfully, now thanks to Swamp denizens)
Here's what I got so far:
Code: [Select]
(defun c:ROT3 (/ acadObject Arxlist strArx cmdold entgrp rotax ang deg)
  (vl-load-com)
  (setq acadObject (vlax-get-acad-object))
  (setq Arxlist (vla-listarx acadObject))
  (setq strArx (vlax-safearray->list (vlax-variant-value arxlist)))
  (defun rtod (a) (/ (* a 180) pi))
  (setq entgrp (ssget))

  (setq cmdold (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (if (= (member '"geom3d.arx" strArx) nil)
    (arxload "geom3d.arx")
  ) ;if
  (setq p1 (getpoint "\nFirst point: ")
p2 (getpoint "\nSecond point: ")
  )
  (if (setq entgrp (ssget))
    (setq rotax (p1 p2 "")) ;rotax
  ) ; if
  (if (setq ang
     (getangle "\nEnter degrees of movement:<5> ")
      )
    (setq deg (rtod ang))
    (setq deg 5)
  ) ;if
  (c:rotate3d entgrp "" rotax "2" "" deg "")
  (setvar "cmdecho" cmdold) ;return echo
  (princ) ;exit quietly
) ;defun

When I test run I get the following on the command line ( using ACAD 2K2):
"Command: rot3
Select objects: Specify opposite corner: 2 found
Select objects:
First point:
Second point:
Select objects:
Enter degrees of movement:<5> 4
Current positive angle:  ANGDIR=counterclockwise  ANGBASE=0
Command:"
So it gets all the way to "c:rotate3d" but looks like it doesn't respond to the next bit" (entgrp "" rotax "2" "" deg "")
I tried to duplicate the command line responses to prompts when 3drotate is entered but something is not quite right. Maybe I need an integer instead of a string or perhaps a real. I'm totally baffled by this one.
Anyone got any ideas?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Rotate3d routine quits without error msg
« Reply #1 on: August 21, 2008, 02:20:49 PM »
Have you tried this?
Code: [Select]
(command "._rotate3d" entgrp "" "_non" p1 "_non" p2 "" "2" "" deg "")
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.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: Rotate3d routine quits without error msg
« Reply #2 on: August 21, 2008, 06:18:53 PM »
HINT Look carefully in the Autolisp reference for the section Externally Defined Commands. Failure to use this method will give you headaches beyond comprehension......