Jump to content

Error on Undoing reactor Object


Recommended Posts

Posted (edited)

Hi guys,

 

I'm a pretty new learner when it comes to doing reactors. I tried doing a LISP routine whereby it draws a rectangle between the insertion points of two blocks. I set my reactors so that when moving the block, the rectangle will update itself as shown below:

 

ezgif.com-video-to-gif.gif.0080e9e82caf128a0257e1f13336641e.gif

 

But something just starts to screw when I undo, because I've always set my AutoLISP to Break on Error. As good practice, as long as the error doesn't show up, I know that I'm doing the right thing.

 

What's really happening to the reactors when you undo, or am I missing something?

 

Thanks,

Jonathan Handojo

Edited by Jonathan Handojo
  • 2 weeks later...
Posted
On 3/10/2020 at 7:13 PM, Jonathan Handojo said:

What's really happening to the reactors when you undo, or am I missing something?

 

Probably your issue is related to setting start/end undomarks of the active document within the callback function(s).

But if you are curious about your question - here is some observation:

 

Modifying a circle's radius and performing undo -

Command:
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 2 "")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 20 "")
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
Command: _u
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 2 "U")
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 1 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 2 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 4 "U")
  :VLR-commandWillStart . ("U")
  :VLR-commandWillStart . ("U")
  :VLR-pickfirstModified . nil
  :VLR-undoSubcommandNumber . (0 1)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
  :VLR-commandEnded . ("U")
  :VLR-commandEnded . ("U")
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 2 4 "#U")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 2 2 "#U")

 

Modifying a circle's radius - which is linked to another circle's radius (so this example is from only 2 linked objects) -

Command:
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 2 "")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 20 "")
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
Command: _u
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 2 "U")
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 1 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 2 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 4 "U")
  :VLR-commandWillStart . ("U")
  :VLR-commandWillStart . ("U")
  :VLR-pickfirstModified . nil
  :VLR-undoSubcommandNumber . (0 1)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
Probably erased.
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 20 20 "#U")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 20 20 "#U")
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
Probably erased.
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-commandEnded . ("U")
  :VLR-commandEnded . ("U")

 

So for short - a bunch of documentLockModeWillChange / documentLockModeChanged, objectOpenedForModify / objectModified events happen, along with 

commandWillStart / commandEnded with argument ("U") - which stands for UNDO.

Reason for the double commandWillStart / Ended is because one event is called from a :vlr-Command-reactor and the other is from :vlr-Editor-reactor, since they have the same events.

 

If I couldn't solve your problem with Start/Undo Marks,

I would probably include a command-reactor to trace for   :VLR-commandEnded . ("U") , so I would 'auto-process' all the linked objects within your object reactor.

 

  • 11 months later...
Posted
On 3/20/2020 at 12:37 AM, Grrr said:

 

Probably your issue is related to setting start/end undomarks of the active document within the callback function(s).

But if you are curious about your question - here is some observation:

 

Modifying a circle's radius and performing undo -


Command:
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 2 "")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 20 "")
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
Command: _u
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 2 "U")
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 1 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 2 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 4 "U")
  :VLR-commandWillStart . ("U")
  :VLR-commandWillStart . ("U")
  :VLR-pickfirstModified . nil
  :VLR-undoSubcommandNumber . (0 1)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1cedb0>)
  :VLR-commandEnded . ("U")
  :VLR-commandEnded . ("U")
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 2 4 "#U")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 2 2 "#U")

 

Modifying a circle's radius - which is linked to another circle's radius (so this example is from only 2 linked objects) -


Command:
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 2 "")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 20 20 "")
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
Command: _u
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 2 "U")
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 1 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 1 2 2 "#")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 2 4 4 "U")
  :VLR-commandWillStart . ("U")
  :VLR-commandWillStart . ("U")
  :VLR-pickfirstModified . nil
  :VLR-undoSubcommandNumber . (0 1)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
Probably erased.
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-documentLockModeWillChange . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 20 20 "#U")
  :VLR-documentLockModeChanged . (#<VLA-OBJECT IAcadDocument 0000001d3b3f19a8> 4 20 20 "#U")
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectOpenedForModify . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
Probably erased.
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced90>)
  :VLR-objectModified . (#<VLA-OBJECT IAcadDatabase 0000001d39618888> <Entity name: 1d1d1ced80>)
  :VLR-commandEnded . ("U")
  :VLR-commandEnded . ("U")

 

So for short - a bunch of documentLockModeWillChange / documentLockModeChanged, objectOpenedForModify / objectModified events happen, along with 

commandWillStart / commandEnded with argument ("U") - which stands for UNDO.

Reason for the double commandWillStart / Ended is because one event is called from a :vlr-Command-reactor and the other is from :vlr-Editor-reactor, since they have the same events.

 

If I couldn't solve your problem with Start/Undo Marks,

I would probably include a command-reactor to trace for   :VLR-commandEnded . ("U") , so I would 'auto-process' all the linked objects within your object reactor.

 

 

Sorry for the extremely late response... I didn't understood it then, but now I do. When I read your quote, I think the issue is:

 

When I run the Undo command, the :vlr-commandwillstart fires up, thus inspecting the object that triggered the reactor yielded the following:

 

image.png.9979300f9a857717e77131a153faae9c.png

 

I didn't at all thought it would fire the :vlr-modified event, hence failed... I wanna ask though, where can you get that step-by-step event that's fired when a certain action is taken? Perhaps I can try to work around it if I can get this information.

Posted (edited)

This is just my practice on using reactors... I know this can be done by associating the dimension to the block as opposed to using reactors (even though associating dimensions also uses reactors), but this just serves as practice...

 

I don't know if this is a good approach to avoiding the undo... basically setting a global variable as T when the undo command starts, and then setting it back to nil when it ends. And in the vlr-modified reactor, I use an if function to execute what the modified function does if the flag is inactive. I've included a video below to show how this animation works.

 

(defun c:gdr (/ *error* 05pi acadobj activeundo adoc ang brct dim1 dim2 dimrct dir getblk gr grp grv midpt mpt msp nang ndis ofs p1 p2 pt1 pt2 snp x xvec)
    (defun *error* ( msg )
	(setvar 'snapang snp)
	(mapcar '(lambda (x) (and x (not (vlax-erased-p (car x))) (vl-catch-all-apply 'vla-delete (list (car x))))) (list dim1 dim2))
	(vla-EndUndoMark adoc)
	(if (not (wcmatch (strcase msg T) "*break*,*cancel*,*exit*"))
	    (princ (strcat "Error: " msg))
	    )
	)

    (defun getblk (p msg / pt)
	(setq msg (vl-string-right-trim ":" (vl-string-right-trim " " msg)))
	(while
	    (progn
		(setvar 'errno 0)
		(setq pt (progn (initget "Point") (entsel (strcat msg " or [Point] <exit>: "))))
		(cond
		    ((= (getvar 'errno) 7) (princ "\nNothing selected"))
		    ((null pt) nil)
		    ((eq pt "Point")
		     (setq pt (progn (initget "Block") (apply 'getpoint (append (if p (list p)) (list "\nSpecify point or [Block] <exit>: ")))))
		     (eq pt "Block")
		     )
		    ((not (eq (cdr (assoc 0 (setq pt (entget (car pt))))) "INSERT")) (princ "\nObject is not a block"))
		    ((not (setq pt (cdr (assoc -1 pt)))))
		    )
		)
	    )
	pt
	)

    (setq acadobj (vlax-get-acad-object)
	  adoc (vla-get-ActiveDocument acadobj)
	  msp (vla-get-ModelSpace adoc)
	  activeundo nil)
    (if (= 0 (logand 8 (getvar "UNDOCTL"))) (vla-StartUndoMark adoc) (setq activeundo T))

    (if
	(and
	    (setq p1 (getblk nil "\nSpecify first block: "))
	    (setq p2 (getblk (if (eq (type p1) 'ename) (cdr (assoc 10 (entget p1))) p1) "\nSpecify next block: "))
	    )
	(progn
	    (setq pt1 (if (eq (type p1) 'ename) (cdr (assoc 10 (entget p1))) p1)
		  pt2 (if (eq (type p2) 'ename) (cdr (assoc 10 (entget p2))) p2)
		  xvec (angle '(0 0 0) (trans (getvar 'ucsxdir) 0 2 t))
		  dir (+ xvec (cond ((getangle "\nSpecify dimension angle <0>: ")) (0)))
		  ang (angle pt1 pt2)
		  midpt (JH:midpt pt1 pt2)
		  snp (getvar 'snapang)
		  )
	    (if (not (equal (rem (- ang dir) (setq 05pi (* 0.5 pi))) 0 1e-5))
		(setq dim1 (cons (vla-AddDimRotated msp (vlax-3d-point (trans pt1 1 0)) (vlax-3d-point (trans pt2 1 0)) (vlax-3d-point (trans midpt 1 0)) dir) dir)
		      dim2 (cons (vla-AddDimRotated msp (vlax-3d-point (trans pt1 1 0)) (vlax-3d-point (trans pt2 1 0)) (vlax-3d-point (trans midpt 1 0)) (+ dir 05pi)) (+ dir 05pi))
		      )
		(setq dim1 (cons (vla-AddDimRotated msp (vlax-3d-point (trans pt1 1 0)) (vlax-3d-point (trans pt2 1 0)) (vlax-3d-point (trans midpt 1 0)) ang) ang))
		)
	    (mapcar '(lambda (x) (and x (vla-put-TextMovement (car x) 0))) (list dim1 dim2))
	    (setvar 'snapang (- dir xvec))
	    (while
		(progn
		    (setq gr (grread t 15)
			  grp (cadr gr)
			  grv (car gr)
			  )
		    (cond
			((member grv '(5 3))
			 (mapcar
			     '(lambda (x)
				  (if x
				      (progn
					  (setq mpt (inters midpt (polar midpt (- (+ 05pi (cdr x)) xvec) 1) grp (polar grp (- (cdr x) xvec) 1) nil)
						ofs (mapcar '- mpt midpt)
						)
					  (vlax-put (car x) 'TextPosition (trans (mapcar '+ midpt ofs) 1 0))
					  )
				      )
				  )
			     (list dim1 dim2)
			     )
			 (cond
			     ((= grv 5))
			     ((= 3 grv)
			      (mapcar
				  '(lambda (x y / brct dimrct)
				       (setq dimrct
						(append
						    (if dim1 (list (list y (vlax-vla-object->ename (car dim1)))))
						    (if dim2 (list (list y (vlax-vla-object->ename (car dim2)))))
						    )
					     )
				       (foreach x dimrct
					   (VLR-Object-Reactor
					       (list (vlax-ename->vla-object (cadr x)))
					       brct
					       '(
						 (:VLR-erased . GridDimensionReactive:DimensionErased)
						 (:VLR-unerased . GridDimensionReactive:DimensionUnerased)
						 )
					       )
					   )
				       (VLR-Object-Reactor
					   (if (eq (type x) 'ename) (list (vlax-ename->vla-object x)))
					   (setq dimrct
						    (append
							(if dim1 (list (list y (vlax-vla-object->ename (car dim1)))))
							(if dim2 (list (list y (vlax-vla-object->ename (car dim2)))))
							)
						 )
					   '(
					     (:VLR-erased . GridDimensionReactive:BlockErased)
					     (:VLR-unerased . GridDimensionReactive:BlockUnerased)
					     (:VLR-modified . GridDimensionReactive:BlockModified)
					     )
					   )
				       )
				  (list p1 p2)
				  '(13 14)
				  )
			      (or
				  (and
				      (setq p2 (getblk pt1 "\nSpecify next block: "))
				      (setq pt2 (if (eq (type p2) 'ename) (cdr (assoc 10 (entget p2))) p2)
					    ang (angle pt1 pt2)
					    midpt (JH:midpt pt1 pt2)
					    )
				      (if (not (equal (rem (- ang dir) (setq 05pi (* 0.5 pi))) 0 1e-8))
					  (setq dim1 (cons (vla-AddDimRotated msp (vlax-3d-point (trans pt1 1 0)) (vlax-3d-point (trans pt2 1 0)) (vlax-3d-point (trans midpt 1 0)) dir) dir)
						dim2 (cons (vla-AddDimRotated msp (vlax-3d-point (trans pt1 1 0)) (vlax-3d-point (trans pt2 1 0)) (vlax-3d-point (trans midpt 1 0)) (+ dir 05pi)) (+ dir 05pi))
						)
					  (setq dim1 (cons (vla-AddDimRotated msp (vlax-3d-point (trans pt1 1 0)) (vlax-3d-point (trans pt2 1 0)) (vlax-3d-point (trans midpt 1 0)) ang) ang))
					  )
				      (mapcar '(lambda (x) (and x (vla-put-TextMovement (car x) 0))) (list dim1 dim2))
				      )
				  (progn
				      (setq dim1 nil dim2 nil)
				      (*error* "Exit")
				      )
				  )
			      )
			     )
			 )
			((or
			     (and (= grv 2) (member grp '(13 32)))
			     (= grv 25)
			     )
			 (*error* "Exit")
			 )
			(t)
			)
		    )
		)
	    (setvar 'snapang snp)
	    )
	)
    (if activeundo nil (vla-EndUndoMark adoc))
    (princ)
    )

(if
    (not
	(vl-some
	    '(lambda (a)
		 (eq (VLR-Data a) "GridDimensionReactive")
		 )
	    (cdar (VLR-reactors :VLR-Command-Reactor))
	    )
	)
    (VLR-Command-Reactor "GridDimensionReactive"
	'(
	  (:VLR-commandWillStart . GridDimensionReactive:BeforeUndo)
	  (:VLR-commandEnded . GridDimensionReactive:AfterUndo)
	  )
	)
    )

(defun GridDimensionReactive:BlockErased (obj rct lst) (VLR-Remove rct))

(defun GridDimensionReactive:BlockUnerased (obj rct lst) (and (not (VLR-added-p rct)) (VLR-Add rct)))

(defun GridDimensionReactive:DimensionErased (obj rct lst) (VLR-Remove rct))

(defun GridDimensionReactive:DimensionUnerased (obj rct lst) (and (not (VLR-added-p rct)) (VLR-Add rct)))

(defun GridDimensionReactive:BeforeUndo (rct lst)
    (if (member (car lst) '("U" "UNDO" "REDO" "MREDO"))
	(setq GridDimensionReactive_UndoFlag t)
	)
    )

(defun GridDimensionReactive:AfterUndo (rct lst)
    (if (member (car lst) '("U" "UNDO" "REDO" "MREDO"))
	(setq GridDimensionReactive_UndoFlag nil)
	)
    )

(defun GridDimensionReactive:BlockModified (obj rct lst / 05pi dxfx get)
    (if
	(and
	    (not GridDimensionReactive_UndoFlag)
	    (not (vlax-erased-p obj))
	    )
	(foreach x (VLR-Data rct)
	    (if
		(and
		    (vlax-ename->vla-object (cadr x))
		    (vlax-write-enabled-p (cadr x))
		    )
		(progn
		    (setq get (entget (cadr x))
			  05pi (* 0.5 pi)
			  dxfx (car x)
			  )
		    (entmod
			(mapcar
			    '(lambda (a / ang p1 dxfa)
				 (cond
				     ((= (setq dxfa (car a)) dxfx) (cons dxfa (vlax-get obj 'InsertionPoint)))
				     ((and
					  (= dxfa 11)
					  (setq inp
						   (inters
						       (setq ang (cdr (assoc 50 get)) p1 (JH:midpt (cdr (assoc (if (= dxfx 14) 13 14) get)) (vlax-get obj 'InsertionPoint)))
						       (polar p1 (+ 05pi ang) 10)
						       (cdr a) (polar (cdr a) ang 10)
						       nil
						       )
						)
					  )
				      (cons 11 inp)
				      )
				     (a)
				     )
				 )
			    get
			    )
			)
		    )
		)
	    )
	)
    )

;; JH:midpt --> Jonathan Handojo
;; Returns the midpoint of two points

(defun JH:midpt (a b)
    (mapcar
	'(lambda (x) (/ (float x) 2))
	(mapcar '+ a b)
	)
    )

(vl-load-com)

 

Edited by Jonathan Handojo

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