Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/28/2022 in all areas

  1. This was answered in another post maybe on another forum. You can have a room say with say columns and get floor area. Anyway the simple answer is if you can make a hatch that reflects the correct shape then you can get the area, so would need to edit Lee's code to pick a hatch rather than a pline.
    2 points
  2. I always write the dcl file into the lisp so there is only one file to keep track of. @rlx has a nice converter. https://www.cadtutor.net/forum/topic/66737-convert-dcl-file-to-lisp-file/ (setq fo (open (setq fn (vl-filename-mktemp "" "" ".dcl")) "w")) ;will make a temp file in your temp folder location (write-line "each line of your dcl" fo) ; rlx file convert file here. ... (close fo) (new_dialog "foo" (setq d (load_dialog fn))) ;load like normal ... (vl-file-delete fn) ;deletes temp file from first line.
    1 point
  3. I don't have zwcad and never used it so not sure if its compatible with visual lisp. Maybe there lies your problem because this is mainly a forum for AutoCad. But I tested it on my own system (AutoCad2022) and for me it works. (defun c:RlxOdbxDeleteXref (/ _getfolder dbx_ver app dbxv folder xref-name ) (vl-load-com) (defun _getfolder ( m / sh f r ) (setq sh (vla-getinterfaceobject (vlax-get-acad-object) "Shell.Application") f (vlax-invoke-method sh 'browseforfolder 0 m 0)) (vlax-release-object sh)(if f (progn (setq r (vlax-get-property (vlax-get-property f 'self) 'path))(if (wcmatch r "*\\") r (strcat r "\\"))))) (defun dbx_ver ( / v) (strcat "objectdbx.axdbdocument" (if (< (setq v (atoi (getvar 'acadver))) 16) "" (strcat "." (itoa v))))) (defun void (x) (or (not x) (= "" x) (and (eq 'STR (type x)) (not (vl-remove 32 (vl-string->list x)))))) (setq app (vlax-get-acad-object) dbxv (dbx_ver)) (cond ((void (setq xref-name (getstring "\nEnter name of xref you want to detach : "))) (princ "\nComputer says no : invalid xref name")) ((vl-catch-all-error-p (setq odbx (vl-catch-all-apply 'vla-getinterfaceobject (list app dbxv)))) (princ "\nObject DBX interface not created!")) ((setq folder (_getfolder "Select folder with drawings to delete (ALL) xrefs")) (setq xref-name (strcase xref-name)) (foreach dwg (vl-directory-files folder "*.dwg" 0) (setq dwg (strcat folder dwg)) (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-open (list odbx dwg))) (princ (strcase (strcat "\nError opening: " dwg))) (progn (princ (strcat "\nOpening: " dwg)) ;;; seek & destroy (all) xrefs (vlax-for lt (vla-get-layouts odbx) (vlax-for blkobj (vla-get-block lt) (if (and (eq (vla-get-objectname blkobj) "AcDbBlockReference") (vlax-property-available-p blkobj 'Path) (eq xref-name (strcase (vl-filename-base (vla-get-name blkobj)) t)) ) (vlax-invoke-method blkobj 'Delete) ) ) ) ; save drawing (vla-saveas odbx (vla-get-name odbx)) );end progn );end if (princ "\nDone") ); end foreach ); end setq folder (t (princ "\nComputer says no")) ); end cond (vl-catch-all-apply 'vlax-release-object (list app)) (vl-catch-all-apply 'vlax-release-object (list odbx)) (princ) )
    1 point
  4. Just modify the XML file to suit your AutoCAD version if you have experience with such files otherwise contact Autodesk to help you.
    1 point
  5. Did you do this ? Customer support admir@aolovciceng.com
    1 point
  6. One lisp file is better than two : a lisp file and a dcl file. But I have tons of dcl files so just for fun (Grrr knows all about fun) decided to make a tiny lisp in my lunch break to make this just a little bit more easier for me, myself and I. Probably not the first with this idea , haven't checked it (maybe I should have...) , also haven't tested it much (also should have done this) but hey , almost weekend... so go check youself! ; RLX - 25 Jan 2019 - just another luchtime fun (defun RLX_Convert_Dcl ( / dcl-fn dcl-fp lsp-fn lsp-fp dir base inp) (if (and (setq dcl-fn (getfiled "Select DCL file" "" "dcl" 0)) (setq dcl-fp (open dcl-fn "r")) (setq lsp-fn (strcat (setq dir (car (fnsplitl dcl-fn))) (setq base (cadr (fnsplitl dcl-fn))) "_dcl.lsp")) (setq lsp-fp (open lsp-fn "w"))) (progn (princ (strcat "(defun " base "_Write_Dialog ( )\n (if (and (setq " base "-fn " "(vl-filename-mktemp ") lsp-fp) (prin1 (strcat base ".dcl") lsp-fp) (princ (strcat ")) (setq " base "-fp (open " base "-fn \"w\")))\n") lsp-fp) (princ (strcat " (mapcar \n '(lambda (x)(write-line x " base "-fp))\n (list\n") lsp-fp) (while (setq inp (read-line dcl-fp)) (princ " " lsp-fp)(prin1 inp lsp-fp)(princ "\n" lsp-fp)) (princ (strcat " )\n )\n )\n (if " base "-fp (close " base "-fp))\n)") lsp-fp) (close dcl-fp)(close lsp-fp)(gc) ) ) (if (and lsp-fn (findfile lsp-fn))(startapp "notepad" lsp-fn)) (princ) ) ; (RLX_Convert_Dcl) ; original dcl file name : rlx.dcl ; rlx : dialog ; { label = "RLX (RLX Jan'19)"; ; : list_box { key = "lb"; } ; ok_cancel; ; } ; converted to rlx_dcl.lsp: ;(defun rlx_Write_Dialog ( ) ; (if (and (setq rlx-fn (vl-filename-mktemp "rlx.dcl")) (setq rlx-fp (open rlx-fn "w"))) ; (mapcar ; '(lambda (x)(write-line x rlx-fp)) ; (list ; "rlx : dialog" ; " { label = \"RLX (RLX Jan'19)\";" ; " : list_box { key = \"lb\"; }" ; " ok_cancel;" ; " }" ; ) ; ) ; ) ; (if rlx-fp (close rlx-fp)) ; )
    1 point
×
×
  • Create New...