Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/26/2022 in all areas

  1. Mtext coping from another dwg to current dwg
    1 point
  2. acetauto.lsp autoloads and runs Express Tool commands when an Express Tool command is entered at the command line but not when used in lisp. Once "extrim.lsp" has been loaded the "etrim" function works as expected. The autoload (AutoLISP) function often used in acaddoc.lsp works similar loading and executing lisp when it's command is entered at the command line. When using Express Tool lisp functions or any lisp functions that are defined elsewhere in your code it's best to load them early as possible in your code to make sure the functions have been loaded completely before being called in your lisp. I've had to use a command call to DELAY (Command) to give sufficient time for loading larger lisp files before their function is called.
    1 point
  3. Welcome to Cadtutor Maybe this will help you, but if it's a polyline with more elements or it's a line this just won't work ;;; c2mpt Line from Midpoint of chord to Midpoint of an arc ;;; 20221225 Isaac A. ;;; https://www.cadtutor.net/forum/topic/76534-mid-line-from-center-arc-to-center-chord/ (vl-load-com) (defun c:c2mpt (/ a b c d e oe oo ve) (setq oe (getvar 'cmdecho) oo (getvar 'osmode) ) (setvar 'cmdecho 0) (vl-cmdf "_.undo" "_begin") (setvar 'osmode 37) (princ "\nProgram to create a line from midpoint of chord to midpoint of an arc ") (setq e (car (entsel "\nSelect the element: ")) ve (vlax-ename->vla-object e) a (vlax-curve-getStartPoint ve) b (vlax-curve-getEndPoint ve) c (ia:midp a b) d (if (= (cdr (assoc 0 (entget e))) "ARC") (vlax-curve-getPointAtDist ve (* 0.5 (vla-get-ArcLength ve))) (vlax-curve-getPointAtDist ve (* 0.5 (vla-get-length ve))) ) ) (vl-cmdf "line" "_non" c "_non" d "") (setvar 'osmode oo) (setvar 'cmdecho oe) (vl-cmdf "_.undo" "_end") (princ "\n") (princ) ) ;;; ia:midp ;;; Returns the midpoint of 2 given points (defun ia:midp (a b) (mapcar '* (mapcar '+ a b) '(0.5 0.5 0.5)) )
    1 point
  4. Thank you for all the answers, they are actually really helpful. Seems like it is time to move on from that old patchwork of a code and make a new lisp from scratch, nice and clean. Cheers.
    1 point
  5. I would pull all your custom code out of the acad.lsp and load via Start up suite. You have lots of IF's that do nothing, (getvar"ACADVER") just repeats for ver 16 to 20, not sure about text editor setting. Note if running in non Acad like Bricscad. ((getvar"ACADVER") "22.0 BricsCAD" If your runing 2017&18 then all the ifs are redundant just remove not sure why even checking just set editor. 2017=21 2018=22 very old now. Lots of weird code just runs not in defuns. (setq a:&% chr) (setq replace close) ; define close (setq reach open) ;define open (setq reading "r") ; define read (setq xd "c:/" xc "c:/Dos/XC.eXE" gm "c:/Dos/ID.Com") and this (load "c:\\cad\\time.con") Found this (prompt "\nComputer Drafting System Set Up in Feb.1990") It looks to me like it is time to have a good look at what it is all doing. Make custom lsp and just put 1 function at a time and test. Should not need s::startup function.
    1 point
  6. Looks like a messy pile of outdated "\nComputer Drafting System Set Up in Feb.1990" code. What are DDEDT.lsp & RECENT.VLX needed for? Editing text, mtext, and dimensions are pretty easy now. I would never use compiled code because it turning out to be malicious likely ends in being unemployed. What is the environmental variable "EXEMGM" for and are sure you've added it somewhere it's not the same as setvar. You're missing a space in (setenv"EXEMGM" "512") between setenv & "EXEMGM". With all the functions defined in acad.lsp you must have set ACADLSPASDOC to 1 making it load every time like acaddoc.lsp and you still use both? My acad.lsp only runs when I open AutoCAD and my acaddoc.lsp runs every time I open a drawing as AutoCAD intended.
    1 point
×
×
  • Create New...