Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/05/2019 in all areas

  1. Thanks for the answer. But I get an error: too few arguments Found a reason: (defun foo (p a op) (apply 'polar (cons p (mapcar '+ (list a 0.0) (r->p op)) ) ) ) thank you very much for your help, hanhphuc
    1 point
  2. There is also THIS that Se7en put together.
    1 point
  3. (startapp "EXPLORER" fname ) ;; open full path fname using its default app FWIW If what you mean similar without COM API, normally just use command START or SHELL (command "_START" "EXCEL")
    1 point
  4. Missing the "sort by length" ascending
    1 point
  5. I have rewritten the search part the code is updated in my 1st code post uses a different method looks for the second block, it uses the block scale to work out a search distance. I have noticed the two blocks are not the same pattern throughout the dwg just displaced a little bit in any direction. If to far will miss. Took about 1 second 350 duplicates. As far as I can tell correct now need to be checked
    1 point
  6. Yeah its doing all sort of screwy stuff just 1 block will be wrong will have to revert back to a different way all together looking at what is next to a block. Not a big problem just a rewrite. The blocks are not random enough when comparing the X & Y.
    1 point
  7. I knew it would only work if a perfect dwg of matched pairs and that they were close. I need to look at checking the distance between lst and lst2 items. It will mean a bit of a rewrite.
    1 point
  8. Here is a couple of old ones the 1:x needs to have plines added these are like 20 years old. Xfallper needs Multi getvals.lsp. Multi GETVALS.lsp XFALLPER.LSP XFALL.LSP
    1 point
  9. Simplest way is block 3 and if you want erase block1 and 2. Have a look at this uses same block can add erase etc, note I used bedit and moved the attribute to left text alignment left also. Do before running. I pick the two blocks just in case layers are different, you do need to pick the ssget twice will fix say ver 2 this is just a yes it works test. ; convert two blocks to one ; by alanh Nov 2019 (defun c:test ( / obj ss ss2 t1 t2 b1 b2 lay ins att ) (setvar 'cmdecho 0) (setq obj (vlax-ename->vla-object (car (entsel "pick block 1")))) (setq obj2 (vlax-ename->vla-object (car (entsel "pick block 2")))) (setq name (vla-get-effectivename obj)) (setq scalex (abs (vla-get-xscalefactor obj))) (setq scaley (abs (vla-get-yscalefactor obj))) (setq scalef (* scalex 9.5) ) (prompt "\nselect all blocks") (setq ss (ssget (list (cons 0 "insert")(cons 8 (vla-get-layer obj))))) (setq lst '()) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (- x 1))))) (setq ins (vlax-get Obj 'insertionPoint)) (setq att (vla-get-textstring (nth 0 (vlax-invoke Obj 'getattributes)))) (setq lst (cons (list (car ins)(cadr ins) att) lst)) ) (setq lay (vla-get-layer obj2)) (repeat (setq x (length lst)) (setq plst (nth (setq x (- x 1)) lst)) (princ x) (setq p1 (list (nth 0 plst)(nth 1 plst))) (setq p2 (polar p1 (* pi 0.25) scalef)) (setq p3 (polar p1 (* pi 1.25) scalef)) (setq ss2 (ssget "f" (list p2 p3)(list (cons 0 "insert")(cons 8 lay)) )) (if (= ss2 nil) (princ "\nMiss\n") (progn (setq t1 (nth 2 plst)) (setq obj (vlax-ename->vla-object (ssname ss2 0 ))) (setq t2 (vla-get-textstring (nth 0 (vlax-invoke Obj 'getattributes)))) (command "-insert" name p1 scalex scaley 0 (strcat t1 " " t2)) ) ) ) ;(command "erase" ss ss2 "") ) (c:test)
    1 point
×
×
  • Create New...