TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: dussla on May 13, 2015, 10:35:18 PM
-
i seen this lisp
http://lanloylisp.blogspot.kr/2013/03/PolylineSlice.html
pls is this code is possible ?~~
-
I can do it with few more steps...
(defun c:regs2lws ( / pea ss i reg n k m p z f )
(vl-load-com)
(setq pea (getvar 'peditaccept))
(prompt "\nSelect REGIONS convertable to lwpolylines (lines+arcs) to convert them to LWPOLYLINES...")
(while (null (setq ss (ssget "_:L" '((0 . "REGION")))))
(prompt "\nEmpty sel. set... Try selecting again...")
)
(setq k 0 m 0)
(repeat (setq i (sslength ss))
(setq reg (ssname ss (setq i (1- i))))
(setq n (vlax-safearray->list (vlax-variant-value (vla-get-normal (vlax-ename->vla-object reg)))))
(command "_.UCS" "_W")
(command "_.EXPLODE" reg)
(while (> (getvar 'cmdactive) 0) (command ""))
(if (vl-every '(lambda ( x ) (or (eq (cdr (assoc 0 (entget x))) "LINE") (eq (cdr (assoc 0 (entget x))) "ARC")))
(vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget "_P"))))
)
(progn
(setq m (1+ m) z t)
(setq p (vlax-curve-getstartpoint (entlast)))
(command "_.UCS" "_M" p)
(command "_.UCS" "_ZA" "" n)
(setvar 'peditaccept 1)
(command "_.PEDIT" "_M" (ssget "_P") "" "_J")
(while (> (getvar 'cmdactive) 0) (command ""))
)
(progn
(setq k (1+ k) f t)
(command "_.UNDO" "")
)
)
)
(command "_.UCS" "_W")
(if z (progn (prompt "\nThere were : ") (princ m) (prompt " REGIONS - that were converted to LWPOLYLINES")))
(if f (progn (prompt "\nThere were : ") (princ k) (prompt " REGIONS - that were impossible to be converted to LWPOLYLINES")))
(setvar 'peditaccept pea)
(princ)
)
PLINTAV.LSP from PLINETOOLS posted here :
http://www.cadtutor.net/forum/showthread.php?67924-Draw-polyline-along-with-2-or-more-adjacent-closed-polylines/page3&p=#25
M.R.
-
???
http://bbs.mjtd.com/thread-82692-1-1.html
-
Maybe something like this - stolen from CAB...
HTH, M.R.
[EDIT : Now should work with WCS SPLINEs to create REGIONs...]
[EDIT : Updated again - it was 8 downloads till reattaching...]
[EDIT : Updated again - it was 10 downloads till new reattaching...]
[EDIT : Updated again - it was 4 downloads till new reattaching...]
[EDIT : Updated again - it was 13 downloads till new reattaching...]
-
I've updated mkpoly.lsp ...
Regards, M.R.
:gum:
-
i tested that in 2008
but that is not work ~
-
???
http://bbs.mjtd.com/thread-82692-1-1.html
i tested that
but that is not work
i use 2008
-
dussla, try to scale all entities to reasonable extents... Maybe routine displays that picked boundary point is on boundary... So you should scale it down if your 2D entities are large (to be in range 0,0 to 50,50)... You can use scale factor 0.001 foe ex., and when CAD makes boundaries than scale it up with scale factor 1000.0...
HTH, M.R.
-
This will get you most of the way there: Object Break (http://www.lee-mac.com/objectbreak.html).
-
dussla, try to scale all entities to reasonable extents... Maybe routine displays that picked boundary point is on boundary... So you should scale it down if your 2D entities are large (to be in range 0,0 to 50,50)... You can use scale factor 0.001 foe ex., and when CAD makes boundaries than scale it up with scale factor 1000.0...
Updated again with dynamic fuzzbound - dependable from zoom selection extents... In some cases when some geometry is significantly smaller than selection extents it may pick point on boundary, so that those parts may be skipped...
HTH, M.R.
-
dussla, try to scale all entities to reasonable extents... Maybe routine displays that picked boundary point is on boundary... So you should scale it down if your 2D entities are large (to be in range 0,0 to 50,50)... You can use scale factor 0.001 foe ex., and when CAD makes boundaries than scale it up with scale factor 1000.0...
Updated again with dynamic fuzzbound - dependable from zoom selection extents... In some cases when some geometry is significantly smaller than selection extents it may pick point on boundary, so that those parts may be skipped...
HTH, M.R.
Nice one ! marko.
-
Thanks, I've updated again both mkpoly.lsp and mkpoly-inside.lsp, now with some mods in CAB's code... Have predicted at first glance XLINEs and RAYs, but finally give it up from this... I've created also version based on mkpoly.lsp... It does what's shown on this attached gif...
[EDIT : Updated again - it was 17 downloads till new reattaching...]
-
I've updated again... Found some issues with OVERKILL-MR placed inside mkpoly.lsp and mkpoly-inside.lsp...
My sincerely apology for inconvenience...
M.R.
-
One more usage... Now added LM's outline functions... Valid entities are : LINE, LWPOLYLINE, ARC, CIRCLE... (not ELLIPSE, or SPLINE)... Routine is called WALLS.lsp
Hope you like it...
M.R.
[EDIT : Minor change - 21 downloads till I reattached walls.lsp and added walls2d.lsp]
[EDIT : Updated again - it was 8 downloads till new reattaching...]
-
One more usage... Now added LM's outline functions... Valid entities are : LINE, LWPOLYLINE, ARC, CIRCLE... (not ELLIPSE, or SPLINE)... Routine is called WALLS.lsp
Hope you like it...
M.R.
Great , marko. I think you need replace your Gif Record Software
http://www.cockos.com/licecap/
-
marko. why?
Enter inside wall width : 10 actual value :20
inside wall height :50
Enter outside wall width : 20 actual value :5
outside wall height :100
-
emk2012, I don't have those problems... Maybe it's because I don't use OSNAPs... Place (setvar 'osmode 0) line right before main code - inside (defun c:walls ( / ... ))
(defun c:walls ( / ... )
(vl-load-com)
(defun *error* ( msg )
...
(princ)
)
... here ... (setvar 'osmode 0)
... rest of code ...
(*error* nil)
)
M.R.
-
I've updated my lisps posted here :
http://www.theswamp.org/index.php?topic=49453.msg546152#msg546152
Minor changes inside LM's outline function...
-
I've updated my lisps posted here :
http://www.theswamp.org/index.php?topic=49453.msg546152#msg546152
Minor changes inside LM's outline function...
Thanks for sharing!
-
Have found some lacks in walls and walls2d.lsp... Updated all posted routines in this topic...
Regards, M.R.
:wink:
-
I've successfully updated all my walls lisps to be now applicable for latest versions of ACAD... On A2012+ it should operate on all type of 2d curves that lie in WCS (splines+ellipses included) - it uses OFFSETEDGE command... All lisps that have suffix *-old.lsp are intended to be used on versions A2012-... Lisps without suffix "old" are for A2012+...
HTH, M.R.