Author Topic: Function fails without (Alert "we got here")  (Read 734 times)

donnieworld

  • Member
  • *
  • Posts: 24
Function fails without (Alert "we got here")
« 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!

Fred Tomke

  • OpenDCL Technician
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2115
Re: Function fails without (Alert "we got here")
« Reply #1 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
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]