Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/20/2025 in all areas

  1. @Marcin O An example of using entmakex to create the line: ;; Change this (command "_line" (list 10 end_x end_y 0) (list end2_x end2_y 0) "") ;; to this (entmakex (list '(0 . "LINE") (list 10 end_x end_y 0) (list 11 end2_x end2_y 0)))
    3 points
  2. @GLAVCVS@Steven P Thank You for suggestions. You are right , probably that's the issue. I've spent so many hours for try and error. I researched a lot where the issue might be! You've just spot the issue instantly
    2 points
  3. Hi The first thing you should check is whether the lines with length 0 have anything to do with OSMODE: disable the object snap and run the command again to check.
    2 points
  4. I know excellent mathematicians who don't have programming ability. A real creative programmer is like an artist, you need talent in this field. Yes, you can understand some of the functions and capabilities of Lisp programming, but not everyone can become a talented programmer.
    1 point
  5. Yes. It makes sense at first glance. But perhaps mathematics and linguistics aren't so closely related. People with autism, for example, often have special talents for mathematics yet limited communication skills. Furthermore, these are activities that take place in different areas of the brain. Perhaps the brain of a good programmer has to give up some of its mathematical and linguistic abilities to find the necessary balance.
    1 point
  6. As Glavcvs suggests, try this: (command "_line" "non" (list end_x end_y 0) "non" (list end2_x end2_y 0) "") where non stops object snaps temporarily. Often a cause for error where it snaps to the wrong thing. My preference is to make entities with the entmake method - objects are placed exactly irrespective of object snaps or grid settings
    1 point
  7. Steven P that is what I attempted to do, if you click in a Edit box can call a defun say reversetext but you can you use GRREAD or any type of input without closing the dcl, then reopen with the edit box filled in. I know going back to my code I typed A B C D E and got EDCBA in next edit box. So could call a CHILD dcl to do the reverse with 2 edit boxes. I am sure it's just something I am missing that when I enter say "A" in edit box 1 it auto updates edit box 2 and reset edit box 1 back to "". Try the code and you will see the reverse occurs, without closing the dcl. Enter A box1 click box two go back to box1 type next character click box2 to see update, repeat. So my question I am missing an auto do action_tile update when a single character entered. Could not find a reference to force update. Not sure if OpenDCL supports that action. Iwould think its there just a dcl setting.
    1 point
  8. Here, quickly written, but you can start with it and develop further more... (defun c:blksconnect ( / mid ss i blklst ll ur att n pp ) (or (not (vl-catch-all-error-p (vl-catch-all-apply (function vlax-get-acad-object) nil))) (vl-load-com)) (defun mid ( p1 p2 ) (mapcar (function (lambda ( a b ) (/ (+ a b) 2.0))) p1 p2) ) (if (setq ss (ssget (list (cons 0 "INSERT") (cons 66 1)))) (progn (repeat (setq i (sslength ss)) (setq blklst (cons (ssname ss (setq i (1- i))) blklst)) ) (foreach blk blklst (vla-getboundingbox (vlax-ename->vla-object blk) (quote ll) (quote ur)) (mapcar (function set) (list (quote ll) (quote ur)) (mapcar (function safearray-value) (list ll ur))) (setq ll (trans ll 0 1) ur (trans ur 0 1)) (setq att (entnext blk)) (while (and att (setq n (cdr (assoc 1 (entget att))))) (if (numberp (setq n (atoi n))) (setq blklst (subst (list n (mid ll ur)) blk blklst)) ) (setq att (entnext att)) ) ) (setq blklst (vl-sort blklst (function (lambda ( a b ) (< (car a) (car b)))))) (vl-cmdf "_.pline" "_non" (setq pp (cadar blklst))) (foreach p (cdr (mapcar (function cadr) blklst)) (vl-cmdf "_non" (list (car p) (cadr pp))) (vl-cmdf "_non" (setq pp p)) ) (vl-cmdf "") ) ) (princ) )
    1 point
  9. Maybe the OP's request is for horizontal distances (see posted dwg/csv). ;Copyright © pBe (Defun c:demo (/ csvfile cnt sn i a hyp h progr) (vl-load-com) (if (and (= (getvar 'DwgTitled) 1) (setq ss (ssget "_:S:E" '((0 . "POLYLINE")(-4 . "&=") (70 . ))) ) (progn (setq csvfile_ (strcat (getvar 'DWgprefix) (vl-filename-base (getvar 'dwgname)) ".csv" ) ) (setq csvfile (open csvfile_ "w")) (write-line "Distance,Elevation" csvfile) (setq cnt 0 sn (ssname ss 0) progr 0.) (setq param (fix (vlax-curve-getEndParam sn))) (repeat (1+ param) (if (> cnt 0) (progn (setq hyp (- (vlax-curve-getdistatparam sn cnt) (vlax-curve-getdistatparam sn (- cnt 1)))) (setq h (- (last (vlax-curve-getpointatparam sn cnt)) (last (vlax-curve-getpointatparam sn (- cnt 1))))) (setq progr (+ progr (sqrt (- (* hyp hyp) (* h h))))) ) (progn (setq hyp (vlax-curve-getdistatparam sn cnt)) (setq h (last (vlax-curve-getpointatparam sn cnt))) (setq progr 0.) ) ) (write-line (strcat (rtos progr 2 7) "," (rtos (last (vlax-curve-getpointatparam sn cnt)) 2 4) ) csvfile ) (setq cnt (1+ cnt)) ) (close csvfile) (startapp "notepad" csvfile_) ) ) (princ) )
    1 point
×
×
  • Create New...