Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/26/2021 in all areas

  1. @mhupp FWIW, You don't need to convert ename to object when using curve functions .. it's actually faster! (setq e (car (entsel))) (setq o (vlax-ename->vla-object e)) (benchmark '((vlax-curve-getdistatparam e (vlax-curve-getendparam e)) (vlax-curve-getdistatparam o (vlax-curve-getendparam o)) ) ) ;;;Benchmarking ..................Elapsed milliseconds / relative speed for 32768 iteration(s): ;;; ;;; (vlax-curve-getDistAtParam E (vlax-c...).....1500 / 1.85 <fastest> ;;; (vlax-curve-getDistAtParam O (vlax-c...).....2781 / 1.00 <slowest> ;;; ;;;---- Benchmark Utility: In memory of Michael Puckett ----
    1 point
  2. Hi Again, The problem is solved. Now I'm able to insert the block in the Model Space and then use it to make the array. And yes, I went to the Layout tab and it was full of blocks pasted on it . I would like to thank you again mhupp for your help. If i have ay more doubts I will write again on the forum. See you.
    1 point
  3. Hi there. Have u tried Lee Mac's lisps? he often has the lisp u are looking for.. in specific to ur request there is a lisp he has that could help>> ClickHere i bookmarked leemac's site on my workstation PC
    1 point
  4. Make sure the insertion point of the block is also lower left. http://www.lee-mac.com/changeblockinsertion.html
    1 point
  5. This is dump text will work with TEXT & Mtext. just save it as textdump.scr and use it in conjunction with Accoreconsole. (defun wow ( / ss fo) (setq fo (open "d:\\acadtemp\\textout.txt" "A")) (setq ss (ssget "X" '((0 . "*TEXT")))) (repeat (setq x (sslength ss)) (write-line (strcat (getvar 'dwgprefix) (getvar 'dwgname) ","(cdr (assoc 1 (entget (ssname ss (setq x (1- x))))))) fo) ) (close fo) ) (wow) Re update you would have to look for a particular dwg name in your master list and update those records with current text values. Could be a big job. Maybe remove from database and add new ones.
    1 point
  6. As your using CIV3D have you thought about using the codes in a better way say making any layer set to be a breakline, with a common prefix or suffix, a code will have a point but also the function of being a string, so maybe add a suffix to the layer EBL-BR, CL-BR, EBR-BR and so on. Then only need a few layers as they will always only have linetypes of any type.
    1 point
  7. afralisp Example? Your using this to insert a title block or something in paper space? only ask because your using vla-get-PaperSpace with a variable ModelSpace. also you don't set a ip point like in the example. You could use one of the two bounding box points instead of ip. (defun c:Si3_TRACKER (/ blk blkname poly minExt maxExt) (vl-load-com) (setq blk (car (entsel "\nSelect Block: "))) (setq blkname (cdr (assoc 2 (entget blk)))) (setq poly (vlax-ename->vla-object (car (entsel "\nSelect Polyline")))) (vla-GetBoundingBox poly 'minExt 'maxExt) (setq minExt (vlax-safearray->list minExt) maxExt (vlax-safearray->list maxExt) ) (vl-cmdf "-Insert" blkname minExt "" "" "") (princ) ) you could also hard code the block either by the path. or if its already in the drawing use quotes around its "name" (vl-cmdf "-Insert" "c:\\blocks\\block1.dwg" minExt "" "" "") (vl-cmdf "-Insert" "block1" minExt "" "" "") (vl-cmdf "-Insert" "block1" pause "" "" "") add pause to let the user select insertion point. can eliminate selecting the polyline and getting the bounding box if all you want to do is select the bottom left of the poly.
    1 point
  8. Two main ways to do this. (defun C:Cexclue2 (/ sel1 sel2) (setq sel1 (ssget "_X" '((8 . "FNCE,GRADE") (0 . "Line,polyline,lwpolyline")))) (setq sel2 (ssget "_X" '((8 . "CONC") (0 . "polyline")))) (foreach ent (mapcar 'cadr (ssnamex sel2)) (ssadd ent sel1) ) (sssetfirst nil sel1) (princ) ) If you using ssget with out "_X" you will need to use the following (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) This selects each selections set and uses the ssget previously selected to create a new selection set. (defun C:Cexclue2 (/ sel1 sel2) (setq sel1 (ssget "_X" '((8 . "FNCE,GRADE") (0 . "Line,polyline,lwpolyline")))) (setq sel2 (ssget "_X" '((8 . "CONC") (0 . "polyline")))) (command "_.Select" sel1 sel2) (setq sel1 (ssget "_P")) (sssetfirst nil sel1) (princ) ) I try and stay away from (command usage because i feel it has a greater potential to cause errors.
    1 point
  9. this should be what your looking for. http://www.lee-mac.com/extractnestedblock.html
    1 point
  10. oh very well then, pic size optimized (defun c:t2 ( / ss i f e l) (vl-load-com) (if (setq f (getvar 'dwgprefix) ss (ssget "x" '((0 . "TEXT")))) (repeat (setq i (sslength ss)) (if (wcmatch (cdr (assoc 1 (entget (setq e (ssname ss (setq i (1- i))))))) "S#,S##") (setq l (cons e l))))) (if l (progn (princ "\nWorking.....") (command "._undo" "_mark") (mapcar '(lambda (x y)(vl-catch-all-apply 'setvar (list x y))) (list 'filedia 'cmdecho 'expert) '(0 0 2)) (vl-catch-all-apply 'vl-cmdf '("._tilemode" 0 "._erase" "_all" """._mview" "0,0" "2.2,1.5" "._zoom" "_e" "._mspace")) (mapcar '(lambda (x / p s) (setq p (cdr (assoc 11 (entget x))) s (cdr (assoc 1 (entget x)))) (vl-catch-all-apply 'vl-cmdf (list "._zoom" "c" (mapcar '+ p '(3 0)) 1.5 "_jpgout" (strcat f s) "w" (mapcar '+ p '(1.9 -0.75)) (mapcar '+ p '(4.1 0.75)) ""))) l) (mapcar '(lambda (x y)(vl-catch-all-apply 'setvar (list x y))) (list 'filedia 'cmdecho 'expert) '(1 1 0)) (vl-catch-all-apply 'vl-cmdf '("._pspace" "._undo" "_back")) ) ) (princ "\nDone") (princ) )
    1 point
×
×
  • Create New...