Jump to content
malkasun

boundary tool

Recommended Posts

malkasun

I want to an answer for this question. I am drawing plans for lands using Autocad. then there no easy method for me to partition those lands. Now I am doing this as mention below. first of will the boundary of the land is drawn to make it a closed object. next using a line elevation part of the land is marked approximately. using the the boundary tool the boundaries make for that marked point. after that the area at the point is measured then the calculated area is compared with the original area. if it is not match a grip is stretch in the boundary object. repeatedly this I have to adjust the relevant area. it is not an easy task.

it will be easy if i can do it as given below. when the grip is edited as the mouse pointer if the area is shown it will be easy. be kind enough to left me know if there is any lisp program available.

Share this post


Link to post
Share on other sites
hanhphuc

hi malkasun, no respond maybe members don't understand your request?

can you elaborate more or attached a drawing with comments?

members here are friendly to help. Thank you

Share this post


Link to post
Share on other sites
Hippe013

If I understand correctly you are looking to adjust a parcel (boundary) area until you achieve the desired area. This is a command in Civil 3D called swing line or slide line under the parcel layout tools. It is not available in vanilla AutoCAD. I haven't come across a lisp file for this process and writing one would prove to be somewhat difficult.

Share this post


Link to post
Share on other sites
BIGAL
writing one would prove to be somewhat difficult

 

It is achievable for a couple of simple shapes a parrallel line with say 4 pts moving the line iteratively along a line at a fixed brg until it gives area with tolerance. Same with fix a pt and swing, the VL-intersectwith will work out the missing pt then just area with known pts. Once curves are introduce yes it beomes complicated except for a few simple variations. Using Bpoly you can get area quickly for any shape. I am pretty sure there is some code out there.

 

ALLOTMENTS.jpg

Share this post


Link to post
Share on other sites
hanhphuc
It is achievable for a couple of simple shapes a parrallel line with say 4 pts moving the line iteratively along a line at a fixed brg until it gives area with tolerance. Same with fix a pt and swing, the VL-intersectwith will work out the missing pt then just area with known pts. Once curves are introduce yes it beomes complicated except for a few simple variations. Using Bpoly you can get area quickly for any shape. I am pretty sure there is some code out there.

 

[ATTACH=CONFIG]50084[/ATTACH]

Thank you for the explain, an image tells more than words :)

Share this post


Link to post
Share on other sites
Snownut

If you have closed polylines for each lot, when you highlite the pline then select a vertex to move, the area is readily visible in the properties box that you can have open at the same time. Although it does not read in real time it updates once vertex is released, giving a fairly quick result. No need to enter any keystrokes to get area property....

 

I imagine a function could be written to accomplish what you are looking for using the grread function and some complicated equations to take into account all possible geometries.

Share this post


Link to post
Share on other sites
BIGAL

Snownut when doing lots you have to enter area required and it just goes bang done, this is the crux of the problem, land development is all based around maximum lots for an area, to manually move is just to hard, Where I am they are down to 300m2. There is probably about 4-5 variations of methods, I posted the two most common. It is much easier to not play with plines using as I suggetsed BPOLY to make final result. If you were doing 10 lots same size its just enter enter 10 times. Its like most things I have access to two software products that just do it.

 

I know YMG was doing stuff on surfaces again this is please add something else for free that CIV3, Stringer, Civilcad or others do and you have to pay for. If I can find time will have a go.

Share this post


Link to post
Share on other sites
Snownut

BigAl,

 

I understand what you are saying, but it was evident the OP does not have a civil package, just trying to give him a tip.

Share this post


Link to post
Share on other sites
hanhphuc

im interested in this experiment, 1st step: Test swing function.

coders are welcome to participate for this task thanx :)

argument: a&b =ename, a= boundary (statistic), b= line to be stretched dynamically.

 

my opinion area by calculation is faster than bpoly, maybe?

 

;Dynamic swing
http://www.cadtutor.net/forum/showthread.php?87809-boundary-tool
;hanhphuc 30/07/14
(defun swingl (a b fuzz / ss c i p1 p l o catch oops ls)
 (if (and (= (vla-get-objectname b) "AcDbLine")
   (setq p1 (getpoint "\nStretch point..")
	 i  5
	 ) ;_ end of setq 
   ) ;_ end of and
   (progn (terpri)
   (while (and (setq l (grread nil 13 0)) (= (car l) 5))
     (setq i (car l)
	   p (cadr l)
	   ) ;_ end of setq
     (redraw (vlax-vla-object->ename a) 4)
     (if (and a b (listp p))
       (progn (vla-put-EndPoint b (vlax-3d-point (trans p 1 0)))
	      (setq catch (vl-catch-all-apply
			    ''((a b)
			       (setq
				l
				(split (vlax-safearray->list (vlax-variant-value (vla-IntersectWith a b 0))) 3 nil)
				)
			       ) ;_ end of lambda
			    (list a b)
			    ) ;_ end of vl-catch-all-apply
		    ) ;_ end of setq
	      ) ;_ end of progn
       ) ;_ end of if
     (setq p1 p)
     (if (< (length l) o)
       (princ "\n")
       (princ "\r")
       ) ;_ end of if
     (if (vl-catch-all-error-p catch)
       (princ)
       (progn (setq oops (cons l oops))
(foreach p l
(markp (trans p 0 1))
)
	 (redraw (vlax-vla-object->ename a) 3)
	      ) ;_ end of progn
       ) ;_ end of if
     (setq o (length l))
     ) ;_ end of while
   (redraw (vlax-vla-object->ename a) 4)
     ) ;_ end of progn
   ) ;_ end of if
 ) ;_ end of defun



;sub function: split
;http://www.cadtutor.net/forum/showthread.php?87320-Break-a-list-in-two-sub-lists&highlight=Split+list
;hanhphuc 
(defun split (lst len opt / ls l i) ; opt, T= by division or nil=by length
(setq i 1 l '() len (if opt (/ (length lst) len) len))
 (while lst
   (setq l (append  l (list(car lst))))
   (if
   (zerop (rem i len))
(setq ls (cons l ls) l nil)
   ) 
   (setq i (1+ i) lst (cdr lst))
 ) ;_ end of foreach
 (if l
   (append (reverse ls) (list  l))
   (reverse ls)
 ) ;_ end of if
) ;_ end of defun

 

Test:

(defun c:test(/ a b fuzz ) 
(if
(and
(setq a (car(entsel "\nPick main entity (static).. ")))
(setq b (car(entsel "\nPick secondary entity (dynamic).. ")))
     )
(apply 'swingl (append (mapcar ''((e) (vlax-ename->vla-object e )) (list a b))'(0.5)))
) ;_ end of if
(princ)
) ;_ end of defun

(defun dtor(_theta)
 (* (/ _theta 180.0) pi)	; _theta=degree, to radian
)

(defun markp (_pt / _sc); R1.4

(setq _sc (/ (getvar 'viewsize) (cadr (getvar 'screensize)))); dynamic
 (grvecs 	(list 	6 _pt (polar _pt (dtor 45) (* 5 _sc))	;;1.4
       	 		6 _pt (polar _pt (dtor 135) (* 5 _sc))
			6 _pt (polar _pt (dtor 225) (* 5 _sc))
                       	6 _pt (polar _pt (dtor 315) (* 5 _sc))
)
 ); grvecs
); mark


;area still pending, by bpoly or other method
http://www.cadtutor.net/forum/showthread.php?87531-Lee-Mac-Geometry-function-explined&highlight=samifox
;hanhphuc 07/07/2014
(defun 2d-area (l)
 (abs
   (/ (apply '-
      (mapcar '(lambda (x y)
   (vxv  ; sub function by LEE MAC
     (mapcar '(eval x) l)
     (mapcar '(eval y)
      (append (cdr l) (list (car l)))
     )
   ) ;_ vxv
        ) ;_ end of lambda
       '(car cadr)
       '(cadr car)
      ) ;_ end of mapcar
      ) ;_ end of apply
      2.
   ) ;_ end of /
   
 );_ end of abs
 
) ;_ end of defun
;; Vector Dot Product  -  Lee Mac
;; Args: u,v - vectors in R^n
(defun vxv ( u v )
   (apply '+ (mapcar '* u v))
)

Edited by hanhphuc

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...