Jump to content

Recommended Posts

Posted

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

Posted

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

Posted

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.

Posted

Oliver, my code just put a number on each on the vertices of the object you have selected.

 

I thought this is what you are looking for?

Posted

An example of the result of my posted code:

 

Example.jpg

 

 

I thought this is what you were looking to achieve?

Posted

ok..i got it..but here is a little problem regarding the text size ht.

 

lot2979a.jpg

 

thanks

Posted

My code just uses the TEXTSIZE variable as set in your drawings - what size would you like it?

Posted

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

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