Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/19/2023 in all areas

  1. Version 1.0.0

    817 downloads

    This is a simple answer to export a Autocad/Bricscad table to excel, it expects a Title line as 1st line, then data etc . Simply pick the table excel will open and be auto filled, you can save then to what ever name required. Can be used as a library file just (load " Table to excel") as it will run automatically.
    1 point
  2. some ssget like "_W" need other infromation to work. in this case it needs two points Lower left and upper right of a rectangle. (ssget "_W" '(3 2) '(5 4)) This will select anything that is 100% inside the rectangle that goes from (3,2) to (5,4) More here or here --Edit (ssget "_X") - is selecting everything in the drawing and doesn't need points. (ssget) - is waiting for you to make a selection by default
    1 point
  3. I think I got it working. main_routine.lsp (I guess there is not need for loading adder function explicitly by (load "voithitiko.lsp") since it's being loaded when the .vlx starts) (defun c:santonis ( / ) (alert (strcat "sum=" (itoa (adder 6 1)))) ) and ;;; Visual LISP make file [V1.0] anter saved to:[C:/Users/antonisg/Dropbox/douleia/autolisp_grafeio/vlx_sense] at:[10/19/23] (PRV-DEF (:target . "anter.VLX") (:active-x . T) (:separate-namespace) (:protected . T) (:load-file-list (:lsp "voithitiko.lsp") (:lsp "main_routine.lsp") ) (:require-file-list) (:ob-directory) (:tmp-directory) (:optimization . st) ) ;; EOF all i did is changing the order of .lsp files at this tab
    1 point
  4. voithitiko.lsp has to be in a folder trusted locations or support path when only calling it out by name (load "voithitiko.lsp") or use the full path (load "C:/Users/antonisg/Dropbox/douleia/autolisp_grafeio/voithitiko.lsp") --Edit https://help.autodesk.com/view/ACDLT/2024/ENU/?guid=GUID-F3639BAA-FD70-487C-AEB5-9E6096EC0255
    1 point
  5. 0. As BIGAL said, if it is not assumed that the file already exists 1. In the case of a routine written by directly controlling .xlsx rather than exporting to a .csv file, Excel cannot be used = the cell contents are being modified, or a message box is displayed. And so on, it doesn't work. 2. If Lisp was not used continuously, but was only running well yesterday, variables that did not handle local variables may have had an effect. 3. If it only works on certain drawings, it could be if you hardcoded the conditions. 4. The code uses visual lisp features, but (vl-load-com) is missing 5. When system variables such as LISPSYS are changed 6. When saving in VSCODE, unlike when saving in Notepad, characters may be corrupted due to incorrect language settings. 7. Try on a PC that does not have Excel installed. 8. In the case of alternative CAD, VARIANT VALUE and SAFEARRAY are specified differently depending on the version. In the case of zwcad, the type restrictions in lisp syntax are more flexible than autocad (In other words, made it roughly and only implemented it...) but I don't know if this is the case for bricscad as well. 9. If you want to process too many drawings at once using script or odbx or something, compared to the PC specifications, When release is not performed properly after execution. In this case, it is okay if a list is output when the (gc) command is entered. If it is not normal, nil is returned. I wrote it roughly as it came to mind, so there may be mistakes. The best thing to do is upload your code and review it.
    1 point
  6. Good solution Exceed but the idea was to get TINDANG to have a go.
    1 point
  7. Just write down what you do manually that is the lisp steps. Good task to start to learn simple lisp coding. Make the 1st point at 0,0,0 Use (setq pt1 '(0 0 0)) (setq pt2 (list (getreal "\nEnter length ") 0 0)) pline Select start of polyline or [Follow] <Last point>:pt1 (0 0 0) Select start of polyline or [Follow] <Last point>: Set next point or [draw Arcs/Distance/Follow/Halfwidth/Width]:w Starting width <0>: 10 Ending width <10>: 0 Set next point or [draw Arcs/Distance/Follow/Halfwidth/Width]:pt2 (20.0 0 0) Set next point or [draw Arcs/Distance/Follow/Halfwidth/Width]: Set next point or [draw Arcs/Distance/Follow/Halfwidth/Width/Undo]: Convert above to lisp, then make block. (command "block" (getstring "\nEnter block name") '(0 0 0) (entlast) "") Please have a go plenty here will help.
    1 point
  8. I have managed to get it right , as it seems to work ok. (defun c:test ( / Lay_Old MySS target_layers ) (setq Lay_Old (getvar 'clayer)) ; Record the current layer (setvar 'clayer "Features_Hatch") ; Set the layer to Features_Hatch. This layer must exist else an error will occur ; Define a list of layers for hatching (setq target_layers '("Layer1" "Layer2" "Layer3")) ; Define a list of block names to hatch (setq block_names '("CIRCL" "Triangle")) (foreach layer_name target_layers (setq MySS (ssget "X" (list '(0 . "*POLYLINE,CIRCLE,ARC,RECTANGLE") (cons 8 layer_name)))) (if MySS (progn (setq i 0) (repeat (sslength MySS) (setq ename (ssname MySS i)) (command "-hatch" "S" ename "" "P" "Solid" "") (setq i (1+ i)) ) ) ) ; Hatch block references (foreach block_name block_names (setq MySS (ssget "X" (list '(0 . "INSERT") (cons 8 layer_name) (cons 2 block_name)))) (if MySS (progn (setq i 0) (repeat (sslength MySS) (setq ename (ssname MySS i)) (command "-hatch" "S" ename "" "P" "Solid" "") (setq i (1+ i)) ) ) ) ) ) (setvar 'clayer Lay_Old) ; Reset the layer to the original current layer (princ) ; End quietly )
    1 point
  9. This lisp almost working, how to make it work on 3dpolylines? This time i have attached dwg example. (defun c:test ( / Lay_Old MySS target_layers ) (setq Lay_Old (getvar 'clayer)) ; Record the current layer (setvar 'clayer "Features_Hatch") ; Set the layer to Features_Hatch. This layer must exist else an error will occur ; Define a list of layers for hatching (setq target_layers '("Layer1" "Layer2" "Layer3")) (foreach layer_name target_layers (setq MySS (ssget "X" (list '(0 . "LWPOLYLINE,CIRCLE,ARC,RECTANGLE") (cons 8 layer_name)))) (if MySS (progn (setq i 0) (repeat (sslength MySS) (setq ename (ssname MySS i)) (command "-hatch" "S" ename "" "P" "Solid" "") (setq i (1+ i)) ) ) ) ) (setvar 'clayer Lay_Old) ; Reset the layer to the original current layer (princ) ; End quietly ) test.dwg
    1 point
×
×
  • Create New...