Author Topic: Difference in LISP functionality ACAD & BricsCAD  (Read 4924 times)

0 Members and 1 Guest are viewing this topic.

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #15 on: September 19, 2023, 10:38:51 AM »
get/set property I think is in later versions of Bricscad I have V20. I think I read somewhere like V23 has it, same as some of the VL functions where missing and now some 100+ where added. VLA where their but not Vlax versions.
Good to know. I don't run BricsCAD but have written code for many that may being running older versions.
Tested: only in  >=V22
: (command "_circle" "2,2" 2) nil
: (getpropertyvalue (entlast) "radius") 2.0

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #16 on: September 19, 2023, 11:29:52 AM »

I have been working with BricsCAD for many years (since V9 and before with LTExtender), I have extracted some annotations and conditions from my Lisp.
I apologize if they are not explained well, I will do so if requested. I hope it's useful.
Code: [Select]
#BCFlg = BricsCADFLag


(or #BCFlg (command "_.CONVERT" "_HATCH" or "_All" ...))  > not exits


(or cal (if #BCFlg (load "cadcal") (arxload "GEOMCAL")))


(if #BCFlg
   (vl-cmdf "_.EXPLODE" SelSet) ; > better
   (progn (setvar "QAFLAGS" 1) (vl-cmdf "_.EXPLODE" SelSet "") (setvar "QAFLAGS" 0)); to explode more objects
)
     
(if (and (null #BCFlg) (> (atof (getvar "ACADVER")) 23.0))
  (command "_CLASSICINSERT")
  (progn (initdia 1) (command "_.INSERT"))
)


(or #BCFlg (vl-cmdf "_.MLEADER" ... different))


(vl-cmdf "_.ZOOM" "_OBJECT" ...) only in new versions - AutoCAD >19.1 OK
 
(vla-put-GraphicsWinLayoutBackgrndColor AcDisp (if #BCFlg 255 16777215)) ; in Brics bianco = 255 - il nero è 0
 
(if #BCFlg (vl-cmdf "_WCLOSEALL" ...) (vl-cmdf "_CLOSEALL" ...))


"_.WBLOCK" (if #BCFlg (strcat FulNam "." FilTyp) FulNam) > BricsCAD need extension


(defun C:ALE_Utl_Redo ( )
 (if #BCFlg (command "_redo")(command "_mredo" "1"))
 (princ)
)


(if #BCFlg (command "_.PRINT") (progn (initdia) (command "_.PLOT")))


> BricsCAD use only English names
 "ISO pagina intera A0 (841 x 1189 mm)"   "ISO full bleed A0 (841.00 x 1189.00 MM)"


(if #BCFlg "Print As PDF.pc3" "DWG To PDF.pc3")
 
(command "_.ZOOM" (strcat "10" (if #BCFlg "XP" "X_P")))


(if #BCFlg
  (command "_.POLYGON" "6" pt1 "_S" ...different)
  (command "_.POLYGON" "6" pt1 "_C" ...different)
)


(if           ;AutoCAD  in W7-64 (getvar "PLATFORM") "Microsoft Windows NT Version 6.1 (x64)"
  (and; PROCESSOR_ARCHITECTURE restituisce "AMD64" anche su processore Intel ma restituisce "x86" su Bricscad in W7 64bit
    (setq PrcArc (getenv "PROCESSOR_ARCHITECTURE"))
    (< 1 (strlen PrcArc))
    (or (eq "64" (substr PrcArc (1- (strlen PrcArc)))) #BCFlg)
  ); da migliorare perchè in Bricscad su 32 bit non funziona
  (setq SldLib "\\slidelib_x64.exe ")
  (setq SldLib "\\slidelib.exe ")
)
     
#BCFlg > (getenv  "DefaultFormatForSave") > nil


; Con BricsCAD (Ita/Eng) la scrittura di valori numerici in Excel (italiano) avviene con la sostituzione del punto
; decimale in virgola al contrario di AutoCAD (Ita/Eng) che lascia il punto
;
(defun MsX_AutoPutNumericValue2 (CelObj ImpVal DecPrc)
  (cond
    ( (null ImpVal) )
    ( (= ImpVal "") (msxm-Clear CelObj) )
    ( #BCFlg        (msxp-put-Value2 CelObj ImpVal) )
    ( (= 'STR (type ImpVal))  (msxp-put-Value2  CelObj (vl-string-translate "." ","                 ImpVal)) )
    ( T                       (msxp-put-Value2  CelObj (vl-string-translate "." "," (rtos ImpVal 2 DecPrc))) )
  )
  (vlax-release-object CelObj)
)


; Function: ALE_Dim_SetChildStyle
;
; Version 1.01 - 10/10/2010


; Description:
;   Workaround for Bricscad to use Dimstyles child (0,3)
;
; Examples: (ALE_Dim_SetChildStyle "dimlinear")      (ALE_Dim_SetChildStyle "dimangular")
;
;
(defun ALE_Dim_SetChildStyle (DimTyp / CurDSt BasNam)
  (if #BCFlg
    (progn
      (setq
        CurDSt (vla-get-Name (vla-get-activedimstyle *AcAcDwg*))
        BasNam (vl-string-right-trim "$03" CurDSt)
      )
      (cond
        ( (= DimTyp  "dimdiameter")
          (cond     ; $3 Stile per diametri
            ( (wcmatch CurDSt "*$3") )
            ( (tblsearch "DIMSTYLE" (strcat BasNam "$3"))
              (command "_.DIMSTYLE" "_RESTORE" (strcat BasNam "$3"))
            )
            ( (and (wcmatch CurDSt "*$#") (tblsearch "DIMSTYLE" BasNam))
              (command "_.DIMSTYLE" "_RESTORE" BasNam)
            )
          )
        )
        ( (wcmatch DimTyp "dimlinear,dimcontinue,dimaligned,dimbaseline")
          (cond     ; $0 Stile lineare ISO-25 (tipi allineati e ruotati)
            ( (wcmatch CurDSt "*$0") )
            ( (tblsearch "DIMSTYLE" (strcat BasNam "$0"))
              (command "_.DIMSTYLE" "_RESTORE" (strcat BasNam "$0"))
            )
            ( (and (wcmatch CurDSt "*$#") (tblsearch "DIMSTYLE" BasNam))
              (command "_.DIMSTYLE" "_RESTORE" BasNam)
            )
          )
        )
        ( (and (wcmatch CurDSt "*$#") (tblsearch "DIMSTYLE" BasNam))
          (command "_.DIMSTYLE" "_RESTORE" BasNam)
        )
      )
    )
  )
  (princ)
)

mailmaverick

  • Bull Frog
  • Posts: 494
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #17 on: September 21, 2023, 05:10:40 AM »
I have noticed that BricsCAD has additional functionality over AutoCAD in Supporting VisualLISP Extension Functions Library, which are not inbuilt in AutoCAD. See below link :-

https://developer.bricsys.com/bricscad/help/en_US/V23/DevRef/source/VLELISPFunctionLibrary.htm

Correct me if I'm wrong.

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1451
  • Marco
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #18 on: September 21, 2023, 05:28:14 AM »
I have noticed that BricsCAD has additional functionality over AutoCAD in Supporting VisualLISP Extension Functions Library, which are not inbuilt in AutoCAD. See below link :-

https://developer.bricsys.com/bricscad/help/en_US/V23/DevRef/source/VLELISPFunctionLibrary.htm

Correct me if I'm wrong.
you wrote correctly:
As vle-extension.lsp uses pure AutoLISP code only, it will work not only under Windows, but also running Linux and Macintosh OS.
Compatibility with AutoCAD and other AutoLISP-compatible CAD systems
We provide an emulation Lisp file vle-extension.lsp, installed with each BricsCAD version, and part of this package - this defines all VLE functions, if not provided as built-in functions.
To keep AutoLISP code compatible under all BricsCAD and AutoCAD platforms and versions, AutoLISP applications can simply load the file vle-extension.lsp in AutoCAD  and BricsCAD, under all versions; as BricsCAD V12.2 and higher provide these VLE functions 'built-in', loading this file has no impact at all (VLE functions from this file are only  defined when the built-in functions are not present).
Because the BricscCAD built-in VLE function set will grow with each BricsCAD version, it is a good idea to load this file under BricsCAD always (taken from the latest version of BricsCAD, copied to the application).
All those VLE functions, which have no useful meaning under AutoCAD, are implemented as 'no operation', so AutoLISP code is not affected in negative sense.


domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #19 on: September 21, 2023, 05:48:24 AM »
where can I download the vle-extension.lsp file?

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #20 on: September 21, 2023, 06:01:07 AM »
It is worth noting that the vle-extensions.lsp is provided purely to facilitate compatibility with AutoCAD and other platforms which support the LISP API; on BricsCAD, the functions defined within vle-extensions.lsp are implemented directly in C++, offering a significant performance advantage.

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #21 on: September 21, 2023, 01:31:43 PM »
It is worth noting that the vle-extensions.lsp is provided purely to facilitate compatibility with AutoCAD and other platforms which support the LISP API; on BricsCAD, the functions defined within vle-extensions.lsp are implemented directly in C++, offering a significant performance advantage.

ok!
but where can I download vle-extensions.lsp ?
. . . just to take a look at it !

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #22 on: September 21, 2023, 02:08:40 PM »
It is worth noting that the vle-extensions.lsp is provided purely to facilitate compatibility with AutoCAD and other platforms which support the LISP API; on BricsCAD, the functions defined within vle-extensions.lsp are implemented directly in C++, offering a significant performance advantage.

ok!
but where can I download vle-extensions.lsp ?
. . . just to take a look at it !

https://boa.bricsys.com/applications/a/?lisp-developer-support-package-(ldsp)-a720-al1176

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #23 on: September 21, 2023, 02:31:44 PM »
@lee mac
Thank you

mailmaverick

  • Bull Frog
  • Posts: 494
Re: Difference in LISP functionality ACAD & BricsCAD
« Reply #24 on: September 30, 2023, 07:36:39 AM »
Has anyone tried BricsCAD v 24 Beta ?
Any significant improvements found with respect to VLisp ?