Recent Posts

Pages: 1 [2] 3 4 ... 10
11
AutoLISP (Vanilla / Visual) / Re: Draw diagonal hatch lines in rectangle by pick
« Last post by Tharwat on April 15, 2021, 05:48:00 PM »
Here is my attempt for your second request and hopefully Ron won't mind.
Code - Auto/Visual Lisp: [Select]
  1. ;; https://www.theswamp.org/index.php?topic=56680.new#new
  2. (defun c:Test ( / old new ins lst pt1 pt2 pt3 pt4 tmp div zro prt hor vrt prt 1pt 2pt)
  3.   ;; Tharwat - Date: 16.Apr.2021        ;;
  4.   (and (or (/= 4 (logand 4 (cdr (assoc 70 (entget (tblobjname "LAYER" (getvar 'CLAYER)))))))
  5.            (alert "Current layer is locked!. unlock then try again")
  6.            )
  7.        (setq old (entlast))
  8.        (setq ins (getpoint "\nSpecify a point in closed area : "))
  9.        (vl-cmdf "_.-boundary" "A" "O" "P" "" "none" ins "")
  10.        (or (not (equal old (setq new (entlast))))
  11.            (command "_.regen")
  12.            (alert "Invalid point. Try again")            
  13.            )
  14.        (progn
  15.          (foreach itm (entget new)
  16.            (and (= (car itm) 10) (setq lst (cons (cdr itm) lst)))
  17.            )
  18.          lst
  19.          )
  20.        (or (and (= 4 (length lst))
  21.                 (setq lst (vl-sort lst '(lambda (j k) (< (car j) (car k)))))
  22.                 (mapcar 'set '(pt1 pt2 pt3 pt4) lst)
  23.                 (or (> (cadr pt2) (cadr pt1))
  24.                     (setq tmp pt1
  25.                           pt1 pt2
  26.                           pt2 tmp)
  27.                     )
  28.                 (or (> (cadr pt4) (cadr pt3))
  29.                     (setq tmp pt3
  30.                           pt3 pt4
  31.                           pt4 tmp)
  32.                     )
  33.                 )
  34.            (and (entdel new)
  35.                 (alert "Invalid polyline was created with more than 4 corners.\nPolyline deleted!")
  36.                 )
  37.            )
  38.        (entdel new)
  39.        (or (initget 6)
  40.            (setq div (getint "\nSpecify number of portions : "))
  41.            )
  42.        (or (and (setq zro (zerop (setq prt (1- div))))
  43.                 (mapcar 'line_ (list pt1 pt2) (list pt4 pt3))
  44.                 )
  45.            (setq hor (distance pt1 pt3)
  46.                  vrt (distance pt1 pt2)
  47.                  prt (/ hor div)
  48.                  )
  49.            )
  50.        (not zro)
  51.        (repeat div
  52.          (setq 1pt (polar pt1 0.0 prt)
  53.                2pt (polar 1pt (* pi 0.5) vrt)
  54.                )
  55.          (mapcar 'line_ (list pt1 pt2) (list 2pt 1pt))
  56.          (or (equal 1pt pt3 1e-4) (line_ 1pt 2pt))
  57.          (setq pt1 1pt pt2 2pt)
  58.          )
  59.        )
  60.   (princ)
  61. (defun line_ (str_ end_) (entmake (list '(0 . "LINE") (cons 10 (trans str_ 1 0)) (cons 11 (trans end_ 1 0)))))
  62.  
12
AutoLISP (Vanilla / Visual) / MsExcel copyright(s) blocked AutoCad?
« Last post by d2010 on April 15, 2021, 01:05:47 PM »
Good day/s
 :glarestraight:
13
Land Lubber / Geographically Positioned / Re: Feature Line Properties
« Last post by MSTG007 on April 15, 2021, 10:15:24 AM »
Thanks Rod, I will look into it more. I think I have the basics squared away.
14
AutoLISP (Vanilla / Visual) / Re: AutoLISP with Microstation
« Last post by domenicomaria on April 15, 2021, 09:41:19 AM »
Quote
How to execute VLISP -function/s totally  isInside C#?

Maybe it is better to execute C# functions inside VLISP !

This is the work that can be done !

C# library functions for VLISP.

15
CAD General / in cad 2017 , What is the virtual dash line in CAD drawing command?
« Last post by dussla on April 15, 2021, 04:29:59 AM »
i used   cad 2008

if  i draw     rectangle  and  polyline  ,   line is  continus line

but    in 2017
if i draw  line and rectangle ,      The vitual  dash line is shown

can i off that ?
16
Try this

https://www.theswamp.org/index.php?topic=47908.0

You can Import online maps + KML + SHP and you can export KML filew from autocad to ggole map. You can do a lot of things . Very good job from VovKa .
17
AutoLISP (Vanilla / Visual) / Re: Help with DoubleOffset lisp - LeeMac Code
« Last post by PM on April 15, 2021, 01:49:40 AM »
Hi BIGAL . Thanks for your time. I try your code but is not working as i expect. Is faster to do filet 0 . Your code create arcs in the roof and became a mess.

Thanks again
18
AutoLISP (Vanilla / Visual) / Re: Help with DoubleOffset lisp - LeeMac Code
« Last post by BIGAL on April 15, 2021, 12:30:16 AM »
Sorry took so long had a few other tasks, it only does ridge caps at moment, there is one spot where in you sample it will not work as you have 2 ridges to close so the search polygon gets confused. So just pick the top of the red line. The same method should be able to be used on the eaves.

Code: [Select]
; fillet offset roof ridges for offset lines equal ridge capping.
; by AlanH April 2021 info@alanh.com.au

(defun AHpllst ( lstpl / x)
(command "_pline")
(while (= (getvar "cmdactive") 1 )
(repeat (setq x (length lstpl))
(command (nth (setq x (- x 1)) lstpl))
)
(command "")
)
)


(defun c:test  ( / oldsnap)
(setq oldsnap (getvar 'osmode))
(setvar 'osmode 1)
(while (setq pt (getpoint "\nPick ridge point "))
(setvar 'osmode 0)
;(setq pt2 (getpoint pt "\nPick gap in ridge lines "))
; (setq ang  (angle pt pt2))
(setq ang 0.0)
(setq pi20 (/ (* 2.0 pi) 20.0))
(setq co-ord '())
(repeat 20
(setq pt2 (polar pt (setq ang (+ pi20 ang)) 0.3))
(setq co-ord (cons pt2 co-ord))
)
(setq co-ord (cons (last  co-ord) co-ord))
(AHpllst co-ord)

(setq obj1 (vlax-ename->vla-object (entlast)))

(setq ss (ssget "F" co-ord '((0 . "LINE")(8 . "ROOF"))))

(setq lst '())
(repeat (setq x (sslength ss))
(setq ent (ssname ss (setq x (- x 1))))
(setq obj2 (vlax-ename->vla-object ent))
(setq pt (vlax-invoke obj2 'intersectWith obj1 acExtendnone))
(setq dist (vlax-curve-getdistatpoint obj1 pt))
(setq lst (cons (list dist pt (cdr (assoc -1 (entget ent)))) lst))
)
(setq lst (vl-sort lst '(lambda (x y) (< (car x)(car y)))))

(vla-delete obj1)
(setvar 'filletrad 0.0)

(setq x 1)
(setvar 'osmode 512)
(setq x 1)
(repeat (- (/ (length lst) 2) 1)
(setq l1 (entget (nth 2 (nth x lst))))
( setq pt1 (mapcar '* (mapcar '+ (cdr (assoc 10 l1)) (cdr (assoc 11 l1))) '(0.5 0.5)))
(setq l2 (entget (nth 2 (nth (+ x 1) lst))))
( setq pt2 (mapcar '* (mapcar '+ (cdr (assoc 10 l2)) (cdr (assoc 11 l2))) '(0.5 0.5)))

(command "fillet" pt1 pt2  )
(setq x (+ x 2))
)
(setq l1 (entget (nth 2 (nth 0 lst))))
( setq pt1 (mapcar '* (mapcar '+ (cdr (assoc 10 l1)) (cdr (assoc 11 l1))) '(0.5 0.5)))
(setq l2 (entget (nth 2 (last lst))))
( setq pt2 (mapcar '* (mapcar '+ (cdr (assoc 10 l2)) (cdr (assoc 11 l2))) '(0.5 0.5)))
(command "fillet" pt1 pt2  )

(setvar 'osmode 1)

)
(setvar 'osmode oldsnap)
(princ)

)
(c:test)


19
Land Lubber / Geographically Positioned / Re: Feature Line Properties
« Last post by Rod on April 14, 2021, 08:18:25 PM »
Doslib has a function "dos_clipboard" to get or set a string to the clipboard which is pretty straightforward and what I use.

Highflyingbird also mentions a few different methods here https://www.theswamp.org/index.php?topic=38102.0;all
20
AutoLISP (Vanilla / Visual) / Re: AutoLISP with Microstation
« Last post by d2010 on April 14, 2021, 03:00:38 PM »
Perhaps, we need increase the speed of LISP with dot.Net.
We need research, how to increase the speed of VLISP inside Bri?Cad or Aut?Cad.
How to execute VLISP -function/s totally  isInside C#?
 :embarrassed:
Oh, of course.
Quote
Maybe the answer could be BricsCAD, BLADE and OpenDCL.
I want mean that BricsCAD, BLADE and OpenDCL
could be a solution for Visual(?)Lispers
because Blade and the Lisp of BricsCAD and OpenDCL
are slowly growing . . .
And they haven't stopped for many years like Acad's Lisp.
This has nothing to do with MicroStation, of course.

Pages: 1 [2] 3 4 ... 10