Function fails without (Alert "we got here")

Started by donnieworld, May 17, 2023, 12:45:06 AM

Previous topic - Next topic


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")
      (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

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]