oliver Posted April 19, 2009 Share Posted April 19, 2009 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 19, 2009 Share Posted April 19, 2009 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)))) 1 Quote Link to comment Share on other sites More sharing options...
oliver Posted April 20, 2009 Author Share Posted April 20, 2009 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 Quote Link to comment Share on other sites More sharing options...
NH3man! Posted April 20, 2009 Share Posted April 20, 2009 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 20, 2009 Share Posted April 20, 2009 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? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 20, 2009 Share Posted April 20, 2009 An example of the result of my posted code: I thought this is what you were looking to achieve? Quote Link to comment Share on other sites More sharing options...
oliver Posted April 20, 2009 Author Share Posted April 20, 2009 ok..i got it..but here is a little problem regarding the text size ht. thanks Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 20, 2009 Share Posted April 20, 2009 My code just uses the TEXTSIZE variable as set in your drawings - what size would you like it? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 20, 2009 Share Posted April 20, 2009 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)))) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.