Jump to content

All Activity

This stream auto-updates

  1. Past hour
  2. Just a comment done a lot of find object next to text, just used get text insertion point, then use "ssget "F" pts" the pts are say 10 points made via a polar defun looking like a circle . I noticed you go the other way around looking around the pline for the text. Would be good to get a true sample dwg.
  3. Yep, easier too, since there would be not need to format the string for MText. Even though Python has robust string operations, it’s still weird to get it perfect https://docs.python.org/3/library/string.html I was just following along the original sample. The part I wanted to illustrate was, using a hashmap for mapping points to objects, and using the KD-Tree to do the spatial search I wrote the same KD-Tree and map for AutoLISP, I’m just really bad at lisp, so it’s hard for me to make samples lol https://github.com/CEXT-Dan/ads_geo
  4. Would a table answer be perhaps neater than Mtext ? Just ask for text size for table.
  5. Today
  6. GLAVCVS

    Dimensions

    I've disabled some lines of your code that weren't working and added some new lines of code. I hope this helps.
  7. GLAVCVS

    Dimensions

    Your code, ready. (defun C:bm (/ obj num i obj1 db ct rd ang1 ang2 p1 p2 r ptlist) (setvar "osmode" 0) ; Turn off OSNAP (setq obj (ssget '((0 . "LWPOLYLINE,ARC")))) (setq num (sslength obj)) (setq i 0) (repeat num (setq obj1 (ssname obj i)) (setq db (entget obj1) ptlist (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) db)) i 0 ) (if (= (cdr (assoc 0 db)) "ARC") (progn (setq ct (cdr (assoc 10 db))) (setq rd (cdr (assoc 40 db))) (setq ang1 (* (cdr (assoc 50 db)) (/ 180.0 pi)) ang2 (* (cdr (assoc 51 db)) (/ 180.0 pi)) ) (setq p1 (polar ct ang1 rd)) (setq p2 (polar ct ang2 rd)) (command "_.dimradius" "_non" p1 "_non" p2 "") (command "_.dimarc" "_non" p1 "_non" p2 "") ) ;progn ;;; (progn ;polyline arc segment ;;;;;code (foreach l db (if (= (car l) 10) (if p1 (if bulge (progn (command "_.dimradius" "_non" p1 "_non" (cdr l) "") (command "_.dimarc" "_non" p1 "_non" (setq p1 (cdr l)) "") ; ) ) (setq p1 (cdr l)) ) (if (= (car l) 42) (setq bulge (/= (cdr l) 0.0))) ) ;;; (if (/= bulge 0.0) ;;; (progn ;;; (setq p1 (nth i ptlist)) ;;; (setq p2 (nth (+ i 1) ptlist)) ;;; ;;; (command "_.dimradius" "_non" p1 "_non" p2 "") ;;; (command "_.dimarc" "_non" p1 "_non" p2 "") ; ;;; ) ;progn ;;; ) ;if ) ;progn ) (setq i (1+ i)) ) ;repeat end ; Turn off OSNAP (setvar "osmode" 511) (princ) )
  8. sachindkini

    Associative Textbox (Lee Mac)

    Dear sir one question after i save the drg and again open the drg without this lisp load text or mtext not working... its possible one time used the code and this Associative text are working without upload the code everytime..
  9. sachindkini

    Associative Textbox (Lee Mac)

    thanks sir, its perfect
  10. Lee Mac

    Associative Textbox (Lee Mac)

    It will require more modification than just extending the bulge list - you also need to calculate the positions of the additional vertices. However, I really liked your suggestion (and it's also consistent with my existing Box Text program), and so I've updated the program to Version 1.3 to incorporate a new Filleted Rectangle textbox option (you may need to refresh the page to view the new version). Enjoy!
  11. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/performance-issue-with-read-line-on-large-csv-files/td-p/13865858
  12. Dear Sir, i trying add one more option Slot-1 rectangle with all corner rounded but result not as per image assoctextbox ((= "SLOT-1" typ) '(0.0 0.3 0.0 0.3 0.0 0.3 0.0 0.3)) and also try ((= "SLOT-1" typ) '(0.0 0.3 0.0 0.3 0.0 0.3 0.0 0.3 0.0 0.3 0.0 0.3 0.0 0.3 0.0 0.3)) but result shown wrong i want same result as per attached image AssociativeTextboxV1-2.lsp
  13. Tsuky

    Dimensions

    A start with this ? (vl-load-com) (defun make_mlead (pt o r obj / ptlst arr nw_obj) (setq ptlst (append pt (polar pt o r)) arr (vlax-make-safearray vlax-vbdouble (cons 0 (- (length ptlst) 1))) ) (vlax-safearray-fill arr ptlst) (setq nw_obj (vla-addMLeader Space (vlax-make-variant arr) 0)) (vla-put-contenttype nw_obj acMTextContent) (vla-put-textstring nw_obj (strcat "{\\fArial|b0|i0|c0|p34;R=" (rtos r 2 2) "\\P\\C1You can put here other value}")) (vla-put-layer nw_obj (getvar "CLAYER")) (vla-put-ArrowheadSize nw_obj (* (getvar "TEXTSIZE") 0.5)) (vla-put-TextHeight nw_obj (getvar "TEXTSIZE")) (if (> (car ptlst) (cadddr ptlst)) (progn (vla-SetDogLegDirection nw_obj 0 (vlax-3D-point '(-1.0 0.0 0.0))) (vla-put-TextJustify nw_obj acAttachmentPointMiddleRight) (vla-setLeaderLineVertices nw_obj 0 (vlax-make-variant arr)) ) (vla-put-TextJustify nw_obj acAttachmentPointMiddleLeft) ) (vla-update nw_obj) ) (defun c:rad2lead ( / ent dxf_ent typ_ent mkv vector vlaobj prm id_rad AcDoc Space ent pt1 pt2 pt x) (while (not (setq ent (entsel "\nSelect a bulge: ")))) (setq typ_ent (cdr (assoc 0 (setq dxf_ent (entget (car ent)))))) (cond ((or (eq typ_ent "ARC") (eq typ_ent "CIRCLE") (eq typ_ent "LWPOLYLINE") (and (eq typ_ent "POLYLINE") (zerop (boole 1 120 (cdr (assoc 70 dxf_ent)))) ) ) (if (or (> (fix (car (trans (cadr ent) 1 0))) 1E6) (> (fix (cadr (trans (cadr ent) 1 0))) 1E6)) (setq mkv T vector (trans (cadr ent) 0 0 T) vlaobj (vlax-ename->vla-object (car ent))) (setq mkv nil) ) (if mkv (vla-move vlaobj (vlax-3d-point (trans (cadr ent) 1 0)) (vlax-3d-point '(0.0 0.0 0.0)))) (setq id_rad (distance '(0 0) (trans (vlax-curve-getsecondderiv (car ent) (setq prm (vlax-curve-getparamatpoint (car ent) (vlax-curve-getclosestpointto (car ent) (if mkv '(0.0 0.0 0.0) (trans (cadr ent) 1 0))) ) ) ) 0 (car ent) T ) ) ) (if mkv (vla-move vlaobj (vlax-3d-point '(0.0 0.0 0.0)) (vlax-3d-point vector))) (cond ((not (zerop id_rad)) (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) ) (vla-startundomark AcDoc) (setq ent (car ent)) (if (member typ_ent '("POLYLINE" "LWPOLYLINE")) (setq pt1 (vlax-curve-getPointAtParam ent (fix prm)) pt2 (vlax-curve-getPointAtParam ent (1+ (fix prm))) pt (vlax-curve-getPointAtParam ent (+ (fix prm) 0.5)) ) (setq pt1 (vlax-curve-getStartPoint ent) pt2 (vlax-curve-getEndPoint ent) pt (vlax-curve-getPointAtDist ent (* 0.5 (- (vlax-curve-getDistAtPoint ent pt2) (vlax-curve-getDistAtPoint ent pt1)))) ) ) (setq x (* (fix (/ (angle (mapcar '* (mapcar '+ pt1 pt2) '(0.5 0.5 0.5)) pt) (* 0.125 pi))) 0.125 pi) x (+ x (rem x (* 0.25 pi))) ) (make_mlead pt x id_rad (vlax-ename->vla-object ent)) (vla-regen AcDoc acactiveviewport) (vla-endundomark AcDoc) ) (T (princ "\nSegment have no bulge.")) ) ) (T (princ "\nThis object can't be availaible for this function!")) ) (prin1) )
  14. You can use this to obtain for onely one sheet in excel... ; by patrick_35 ; mods by beekeecz and bonuscad ;(sssetfirst nil (ssadd (handent "2F") (ssadd))) (vl-load-com) (defun c:length_curve2xls ( / AcDoc Space ss factor xls wks lin n obj) (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) ) (princ "\nSelect objects") (cond ((setq ss (ssget (list '(0 . "*POLYLINE,LINE,ARC,CIRCLE") (cons 67 (if (eq (getvar "CVPORT") 1) 1 0)) (cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model")) '(-4 . "<NOT") '(-4 . "&") '(70 . 112) '(-4 . "NOT>") ) ) ) (initget 2) (setq factor (getreal "\nMultiplicative factor to apply to lengths? <1>: ")) (if (not factor) (setq factor 1.0)) (vla-startundomark AcDoc) (setq xls (vlax-get-or-create-object "Excel.Application")) (or (setq wks (vlax-get xls 'ActiveSheet)) (vlax-invoke (vlax-get xls 'workbooks) 'Add) ) (setq wks (vlax-get xls 'ActiveSheet) lin 2 ) (vlax-put xls 'Visible :vlax-true) (vlax-put (vlax-get-property wks 'range "A1") 'value "Handle") (vlax-put (vlax-get-property wks 'range "B1") 'value "Length") (repeat (setq n (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq n (1- n))))) (vlax-put (vlax-get-property wks 'range (strcat "A" (itoa lin))) 'value (strcat "\"" (vlax-get-property obj 'Handle) "\"") ) (vlax-put (vlax-get-property wks 'range (strcat "B" (itoa lin))) 'value (* factor (vlax-get-property obj (cond ((eq (vla-get-ObjectName obj) "AcDbArc") "ArcLength") ((eq (vla-get-ObjectName obj) "AcDbCircle") "Circumference") (T "Length") ) ) ) ) (setq lin (1+ lin)) ) (mapcar 'vlax-release-object (list wks xls)) (gc)(gc) (vla-endundomark AcDoc) ) ) (prin1) ) An if you want to re-labeling your polylines with a field for link with table. (vl-load-com) (defun c:Label_Handle ( / ss htx AcDoc Space n ename obj alpha nw_obj) (princ "\nSelect LWPolylines.") (while (null (setq ss (ssget (list '(0 . "LWPOLYLINE") (cons 67 (if (eq (getvar "CVPORT") 1) 1 0)) (cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model")) ) ) ) ) (princ "\nAren't LWPolylines!") ) (initget 6) (setq htx (getdist (getvar "VIEWCTR") (strcat "\nGive the height of the text <" (rtos (getvar "TEXTSIZE")) ">: "))) (if htx (setvar "TEXTSIZE" htx)) (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) ) (vla-startundomark AcDoc) (repeat (setq n (sslength ss)) (setq ename (ssname ss (setq n (1- n))) obj (vlax-ename->vla-object ename) alpha 0.0 nw_obj (vla-addMtext Space (vlax-3d-point (vlax-curve-GetEndPoint obj)) 0.0 (strcat "{\\fArial|b0|i0|c0|p34;" "%<\\AcObjProp.16.2 Object(%<\\_ObjId " (itoa (vla-get-ObjectID obj)) ">%).Handle \\f \"%tc1\">%" ) ) ) (mapcar '(lambda (pr val) (vlax-put nw_obj pr val) ) (list 'AttachmentPoint 'Height 'DrawingDirection 'Layer 'Rotation) (list 5 (getvar "TEXTSIZE") 5 (getvar "CLAYER") alpha) ) ) (vla-endundomark AcDoc) (prin1) )
  15. GLAVCVS

    Hybrid parallel

    I don't think it's possible to obtain a geometrically correct axis with perpendiculars. Try doing the same thing manually, but with bisectors for each vertex of the two polylines. Extend each bisector to the other polyline and use the midpoints as points for the axis.
  16. devitg

    Dimensions

    @maahee Please upload you sample,dwg . as to test
  17. mhupp

    Hybrid parallel

    just another way to get perpendicular lines https://www.youtube.com/watch?v=GHHY5Na2Tgg a bit more work imo because you would have to create circles for each segment to get the intersecting points. and then trim or extend said line to find the mid point between the two polylines used it a couple of times in wood working when I had to cut something in half but didn't want to walk across the shop to get the tap measure.
  18. maahee

    Dimensions

    (defun C:bm () (setvar "osmode" 0) ; Turn off OSNAP (setq obj (ssget '((0 . "LWPOLYLINE,ARC")))) (setq num (sslength obj)) (setq i 0) (repeat num (setq obj1 (ssname obj i)) (setq db (entget obj1)) (if (= (cdr (assoc 0 db)) "ARC") (progn (setq ct (cdr (assoc 10 db))) (setq rd (cdr (assoc 40 db))) (setq ang1 (* (cdr (assoc 50 db)) (/ 180.0 pi)) ang2 (* (cdr (assoc 51 db)) (/ 180.0 pi)) ) (setq p1 (polar ct ang1 rd)) (setq p2 (polar ct ang2 rd)) (command "_.dimradius" "_non" p1 "_non" p2 "") (command "_.dimarc" "_non" p1 "_non" p2 "") ) ;progn (progn ;polyline arc segment ;;;;;code (if (/= bulge 0.0) (progn (setq p1 (nth r ptlist)) (setq p2 (nth (+ r 1) ptlist)) (command "_.dimradius" "_non" p1 "_non" p2 "") (command "_.dimarc" "_non" p1 "_non" p2 "") ; ) ;progn ) ;if ) ;progn ) (setq i (1+ i)) ) ;repeat end ; Turn off OSNAP (setvar "osmode" 511) (princ) ) ;end 1. It does not obtain dimensions for all arc objects. 2. It does not obtain the dimensions of all polyline arc segments. (command "_.dimradius" "_non" p1 "_non" p2 "") (command "_.dimarc" "_non" p1 "_non" p2 "") ;
  19. here's something in Python, if you can find anything in lisp
  20. sample of this import traceback from pyrx import Db, Ed, Ge, Ap, Rx, Gs @Ap.Command() def doit(): try: # select db = Db.curDb() filter = [(Db.DxfCode.kDxfStart, "TEXT,LWPOLYLINE")] ps, ss = Ed.Editor.select(filter) if ps != Ed.PromptStatus.eOk: raise RuntimeError("Selection Error! {}: ".format(ps)) texts = [Db.Text(id) for id in ss.objectIds(Db.Text.desc())] plines = [Db.Polyline(id) for id in ss.objectIds(Db.Polyline.desc())] # make kdtree & list of points pntmap = {} plpoints = [] for pl in plines: plpoints.append(pl.getStartPoint()) plpoints.append(pl.getEndPoint()) pntmap[pl.getStartPoint()] = pl pntmap[pl.getEndPoint()] = pl # search closest pline results = [] tree = Ge.Point3dTree(plpoints) for text in texts: idxs, _ = tree.knnSearch(text.position(), 1) pl: Db.Polyline = pntmap[plpoints[idxs[0]]] results.append([text.textString(), pl.getDistAtParam(pl.getEndParam())]) # format mtext results = sorted(results, key=lambda x: int(x[0][2:])) buffer = "{:<6}\t{}\\P".format("S.No", "Length Ft") buffer += "".join(f"{sno:<6}\t {plen:>.2f}\\P" for sno, plen in results) # make mtext, add to currentSpace ps, pnt = Ed.Editor.getPoint("\nPick Text Position") mt = Db.MText() mt.setDatabaseDefaults(db) mt.setLocation(pnt) mt.setContents(buffer) cs = db.currentSpace(Db.OpenMode.kForWrite) cs.appendAcDbEntity(mt) except Exception as err: traceback.print_exception(err)
  21. PGia

    Hybrid parallel

    Can you explain that?
  22. I have many polylines, and each one has a text label placed nearby (for example: “L-01” near a polyline with a length of 1.25 ft). I want a program that, once I select the polyline and its nearby text, automatically gives the result based on the text and the polyline’s length. I’ve attached the CAD file here ,please share the suitable program for this. Line Length Sample.dwg
  23. Ajmal

    Electrical Wiring Lsp

    ;;----------------------------=={ SmartPath }==-----------------------------;; ;; ;; ;; Creates a path connecting selected objects using various methods. ;; ;; Synthesized and enhanced by ajmalps, based on concepts from ;; ;; scripts by Kent Cooper, BlackBox, RJP, cab, and others. ;; ;; ;; ;; Command: SmartPath ;; ;; ;; ;;--------------------------------------------------------------------------;; ;; Date: August 6, 2025 (Fixed error handler on clean exit) ;; ;;--------------------------------------------------------------------------;; (vl-load-com) (defun c:SmartPath (/ *error* _get_midpoints _sort_nearest _sort_along_path _get_wire_settings doc ov_osmode ov_cmdecho sort_mode node_ss path_ent point_list sorted_list start_pt output_type layer) ;; --- CORRECTED Robust Error Handler --- (defun *error* (msg) (if ov_cmdecho (setvar 'CMDECHO ov_cmdecho)) (if ov_osmode (setvar 'OSMODE ov_osmode)) (if doc (vla-endundomark doc)) ;; Check if msg is a valid string before trying to process it (if (and msg (not (wcmatch (strcase msg t) "*CANCEL*,*QUIT*,*BREAK*"))) (princ (strcat "\nError: " msg)) ) (princ) ) ;; --- Helper: Get Center of Any Object's Bounding Box --- (defun _get_midpoints (ss / i ent vla_obj pt1 pt2 pt_list) (setq i 0) (repeat (sslength ss) (setq ent (ssname ss i)) (if (and (setq vla_obj (vlax-ename->vla-object ent)) (vlax-method-applicable-p vla_obj 'GetBoundingBox) ) (progn (vla-GetBoundingBox vla_obj 'pt1 'pt2) (setq pt_list (cons (mapcar '(lambda (a b) (/ (+ a b) 2.0)) (vlax-safearray->list pt1) (vlax-safearray->list pt2)) pt_list)) ) ) (setq i (1+ i)) ) pt_list ) ;; --- Helper: Sort by Nearest Neighbor --- (defun _sort_nearest (pt_list / current_pt sorted_list closest_pt) (setq current_pt (car pt_list) pt_list (cdr pt_list) sorted_list (list current_pt)) (while pt_list (setq closest_pt (car pt_list)) (foreach pt (cdr pt_list) (if (< (distance current_pt pt) (distance current_pt closest_pt)) (setq closest_pt pt))) (setq current_pt closest_pt sorted_list (cons current_pt sorted_list) pt_list (vl-remove current_pt pt_list)) ) (reverse sorted_list) ) ;; --- Helper: Sort Along a Guide Path --- (defun _sort_along_path (path_ent pt_list / path_obj) (setq path_obj (vlax-ename->vla-object path_ent)) (mapcar 'cdr (vl-sort (mapcar '(lambda (pt) (cons (vlax-curve-getDistAtPoint path_obj (vlax-curve-getClosestPointTo path_obj pt)) pt)) pt_list) '(lambda (a b) (< (car a) (car b))))) ) ;; --- Helper for Custom Wire Settings --- (defun _get_wire_settings ( / temp_h temp_a) (if (not *wire_height*) (setq *wire_height* 5.0)) (if (not *wire_angle_deg*) (setq *wire_angle_deg* 15.0)) (setq temp_h (getdist (strcat "\nEnter chamfer height <" (rtos *wire_height*) ">: "))) (setq temp_a (getangle (strcat "\nEnter chamfer angle in degrees <" (rtos *wire_angle_deg*) ">: "))) (if temp_h (setq *wire_height* temp_h)) (if temp_a (setq *wire_angle_deg* (/ (* temp_a 180.0) PI))) (list *wire_height* *wire_angle_deg*) ) ;;============== Main Execution Starts Here ============== (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-startundomark doc) (setq ov_cmdecho (getvar 'CMDECHO) ov_osmode (getvar 'OSMODE)) (setvar 'CMDECHO 0) (initget "Nearest Path") (setq sort_mode (getkword "\nSelect sorting mode [Nearest/Path] <Nearest>: ")) (if (not sort_mode) (setq sort_mode "Nearest")) (cond ((= sort_mode "Nearest") (princ "\nSelect objects to connect: ") (if (and (setq node_ss (ssget '((0 . "~VIEWPORT")))) (setq start_pt (getpoint "\nPick point to start path from: ")) (setq point_list (_get_midpoints node_ss))) (setq sorted_list (_sort_nearest (cons start_pt point_list))) ) ) ((= sort_mode "Path") (princ "\nSelect guide path (line, pline, spline, etc.): ") (if (and (setq path_ent (car (entsel))) (princ "\nSelect objects to connect: ") (setq node_ss (ssget '((0 . "~VIEWPORT")))) (setq point_list (_get_midpoints node_ss))) (setq sorted_list (_sort_along_path path_ent point_list)) ) ) ) (if sorted_list (progn (initget "Polyline Line Arc Spline Wire") (setq output_type (getkword "\nSelect output type [Polyline/Line/Arc/Spline/Wire] <Polyline>: ")) (if (not output_type) (setq output_type "Polyline")) (setq layer (getstring (strcat "\nEnter layer for path <" (getvar "CLAYER") ">: "))) (if (= "" layer) (setq layer (getvar "CLAYER"))) (setvar 'OSMODE 0) (princ (strcat "\nDrawing " output_type "...")) (cond ((= output_type "Polyline") (entmakex (append '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (100 . "AcDbPolyline")) (list (cons 8 layer) (cons 90 (length sorted_list)) '(70 . 0)) (mapcar '(lambda (pt) (cons 10 pt)) sorted_list))) ) ((= output_type "Line") (mapcar '(lambda (p1 p2) (entmakex (list '(0 . "LINE") (cons 8 layer) (cons 10 p1) (cons 11 p2)))) sorted_list (cdr sorted_list)) ) ((= output_type "Arc") (mapcar '(lambda (p1 p2 / ptm) (setq ptm (polar (polar p1 (angle p1 p2) (/ (distance p1 p2) 2.0)) (+ (angle p1 p2) (/ PI 2.0)) (* (distance p1 p2) 0.18))) (command "_.ARC" "_none" p1 "_none" ptm "_none" p2) (if (entlast) (command "_.CHPROP" (entlast) "" "_LA" layer ""))) sorted_list (cdr sorted_list)) ) ((= output_type "Wire") (progn (setq settings (_get_wire_settings) w_height (car settings) w_ang_deg (cadr settings) w_ang_rad (/ (* w_ang_deg PI) 180.0)) (mapcar '(lambda (p_start p_end / offset_start offset_end) (setq offset_start (polar p_start (+ (angle p_start p_end) w_ang_rad) w_height) offset_end (polar p_end (- (angle p_end p_start) w_ang_rad) w_height)) (entmakex (list '(0 . "LWPOLYLINE") (cons 8 layer) '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 4) '(70 . 0) (cons 10 p_start) (cons 10 offset_start) (cons 10 offset_end) (cons 10 p_end))) ) sorted_list (cdr sorted_list) ) ) ) ((= output_type "Spline") (entmakex (append '((0 . "SPLINE") (100 . "AcDbEntity") (100 . "AcDbSpline")) (list (cons 8 layer) '(70 . 8) '(71 . 3) (cons 72 (length sorted_list)) (cons 73 (length sorted_list)) '(74 . 0)) (mapcar '(lambda (pt) (cons 11 pt)) sorted_list))) ) ) (princ " Done.") ) (princ "\nPath creation cancelled or no valid objects found.") ) (*error* nil) ) (princ "\n:: SmartPath.lsp loaded. Command: SmartPath ::") (princ) try this
  24. Yesterday
  25. What may speed up the process as well as processing each line individually as suggested is to open the CSV in say notepad and subtly add a "," replacing the (( and )) so the csv becomes more a pattern, I would also change the "-22" to ",-22" again makes the lat and long 2 separate items removing an extra split required in code. This way run Lee-mac string to list and it will split all line values into a single list. I agree process each line via a read, Just read the 1st line as a dummy read removing header info. Then use (while read-line for rest of csv.
  26. if that's the only thing your using doslib for use acet-ui-progress instead. ;; String to List - Lee Mac ;; Separates a string using a given delimiter ;; str - [str] String to process ;; del - [str] Delimiter by which to separate the string ;; Returns: [lst] List of strings (defun LM:str->lst ( str del / pos ) (if (setq pos (vl-string-search del str)) (cons (substr str 1 pos) (LM:str->lst (substr str (+ pos 1 (strlen del))) del)) (list str) ) ) (setq campos (LM:str->lst linha delimitador)) I would say most of your time is in FTTx:Geo->UT and vl-string-trim (setq tipo (vl-string-trim " " (nth 4 campos))) ;why trim (setq titulo (vl-string-trim " " (nth 5 campos))) ;why trim (setq nome (vl-string-trim " " (nth 6 campos))) ;why trim (setq endereco (vl-string-trim " " (strcat tipo " " titulo " " nome))) ;to then add spaces to trim again? fixed to (setq endereco (vl-string-trim " " (strcat (nth 4 campos) (nth 5 campos) (nth 6 campos)))) ;just remove almost 34k vl-string-trim
  27. Since we're all going off topic (thanks a lot Bigal ) , might as well join the band. Added the 'check before paste' lisp to my toolbar. Not sure if I'm ever gonna use it but that wasn't the point, was working on a way to make it a little more easier for myself to update the toolbars for my colleagues (the old last century toolbars , you oldies know what I mean) so lazy as I am , created a button for that too. It hasn't been field tested though so it may or may not work at all... New for me was the help part. Never used html in my life before and also read-write stream only used a couple of times (to create a few .bmp files for the toolbar by means of lisp , look for the Party button) So lets party yeah! euh ...the button I mean (oh just press the darn help button) Easy_Toolbar_Creator.lsp
  28. GLAVCVS

    Hybrid parallel

    Instead of perpendiculars: why not try it with... ...bisectors?
  1. Load more activity
×
×
  • Create New...