OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: donnieworld on May 17, 2023, 12:45:06 AM

Title: Function fails without (Alert "we got here")
Post by: donnieworld on May 17, 2023, 12:45:06 AM
I have a simple function that is failing in BricsCAD if I get rid of the (alert "we got here") line. If I leave this in, the function runs as expected? If I replace it with (princ) the function fails?

Pick start point >
;
; error : during LISP function [c:FastSegmentLabels/frmMain/bArc#OnClicked] invoke from BRX/SDS interface,

(defun c:FastSegmentLabels/frmMain/bArc#OnClicked
   ( / pStart pCenter pEnd lStyles sText oTArc)

  (princ (strcat
      "\nFSL-I: Arcs are defined by the start point, center point, and"
      "\nend point. Arcs are drawn counter clock-wise."
   ))
   
   (alert "we got here")
   
   (while
      (setq pStart (getpoint "\nPick start point > "))
      (setq pCenter (getpoint pStart "\nPick center point > "))
      (setq pEnd (getpoint pCenter "\nPick end point > "))
      (setq lStyles (FSL:SetStyles))
      (setq oTArc (vla-addarc mspace pCenter (distance pStart pCenter) (angle pCenter pStart) (angle pCenter pEnd)))
      (setq sText (FSL:AddSegmentLabel (vlax-vla-object->ename oTArc) (nth 0 lStyles) (nth 1 lStyles)))
      (vla-delete oTArc)
   )

)

>>>>>>>> Please help!
Title: Re: Function fails without (Alert "we got here")
Post by: Fred Tomke on May 30, 2023, 09:25:47 PM
Hello, is it a modal form or a modeless form?
You cannot get access to AutoCAD within an event from a modal form.
Regards, Fred