Jump to content

Boundary Points - Lisp(need help)


oliver

Recommended Posts

i'm just asking a little favor or help..for routine lisp for boundary point..which is i could select an option wether outer nums. or innner nums..generally clockwise rotation as shown in figure attached..also pickone corner for reference for numbering.

 

lot276.jpg

Link to comment
Share on other sites

I suppose this is a starting point...

 

(defun c:bound  (/ cEnt cObj i j)
 (if (and (setq cEnt (car (entsel "\nSelect Curve: ")))
          (member (cdr (assoc 0 (entget cEnt)))
                  '("POLYLINE" "LWPOLYLINE" "REGION")))
   (progn
     (setq cObj (vlax-ename->vla-object cEnt)
           i    (vlax-curve-getStartParam cObj) j 1)
     (while (<= i (- (vlax-curve-getEndParam cObj)
                     (if (vlax-curve-isClosed cObj) 1 0)))
       (Make_Text (vlax-curve-getPointatParam cObj i) (itoa j) 0.0)
       (setq i (1+ i) j (1+ j))))
   (princ "\n<!> Incompatible Curve Selected <!>"))
 (princ))

(defun Make_Text  (pt val rot)
 (entmake (list '(0 . "TEXT")
                '(8 . "0")
                (cons 10 pt)
                (cons 40 (getvar "TEXTSIZE"))
                (cons 1 val)
                (cons 50 rot)
                (cons 7 (getvar "TEXTSTYLE"))
                '(71 . 0)
                '(72 . 1)
                '(73 . 2)
                (cons 11 pt))))

  • Like 1
Link to comment
Share on other sites

I suppose this is a starting point...

 

(defun c:bound  (/ cEnt cObj i j)
 (if (and (setq cEnt (car (entsel "\nSelect Curve: ")))
          (member (cdr (assoc 0 (entget cEnt)))
                  '("LINE" "POLYLINE" "LWPOLYLINE" "REGION")))
   (progn
     (setq cObj (vlax-ename->vla-object cEnt)
           i    (vlax-curve-getStartParam cObj) j 1)
     (while (<= i (- (vlax-curve-getEndParam cObj)
                     (if (vlax-curve-isClosed cObj) 1 0)))
       (Make_Text (vlax-curve-getPointatParam cObj i) (itoa j) 0.0)
       (setq i (1+ i) j (1+ j))))
   (princ "\n<!> Incompatible Curve Selected <!>"))
 (princ))

(defun Make_Text  (pt val rot)
 (entmake (list '(0 . "TEXT")
                '(8 . "0")
                (cons 10 pt)
                (cons 40 (getvar "TEXTSIZE"))
                (cons 1 val)
                (cons 50 rot)
                (cons 7 (getvar "TEXTSTYLE"))
                '(71 . 0)
                '(72 . 1)
                '(73 . 2)
                (cons 11 pt))))

it seems it was familiar with divide blocks..this is not what i meant..:(

anyone else..:)

 

oliver

Link to comment
Share on other sites

Perhaps you could explain a bit more detail. Lee is very good at this and very fast. I know if you can describe what you want he can more than likely put it into a .lsp.

Link to comment
Share on other sites

Going by the TextSize as quoted in your drawing (3):

 

(defun c:bound  (/ cEnt cObj i j)
 (if (and (setq cEnt (car (entsel "\nSelect Curve: ")))
          (member (cdr (assoc 0 (entget cEnt)))
                  '("POLYLINE" "LWPOLYLINE" "REGION")))
   (progn
     (setq cObj (vlax-ename->vla-object cEnt)
           i    (vlax-curve-getStartParam cObj) j 1)
     (while (<= i (- (vlax-curve-getEndParam cObj)
                     (if (vlax-curve-isClosed cObj) 1 0)))
       (Make_Text (vlax-curve-getPointatParam cObj i) (itoa j) 0.0)
       (setq i (1+ i) j (1+ j))))
   (princ "\n<!> Incompatible Curve Selected <!>"))
 (princ))

(defun Make_Text  (pt val rot)
 (entmake (list '(0 . "TEXT")
                '(8 . "0")
                (cons 10 pt)
                (cons 40 3)
                (cons 1 val)
                (cons 50 rot)
                (cons 7 (getvar "TEXTSTYLE"))
                '(71 . 0)
                '(72 . 1)
                '(73 . 2)
                (cons 11 pt))))

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...