Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 in line end we can possible to fix the block..like i am selecting one line,its need to take which side is near end that side my given ""block"" need to be place..... Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 2, 2010 Share Posted November 2, 2010 ummmm.....what? Due to an obvious language barrier, post an image/drawing showing the before and after result. Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 ummmm.....what?Due to an obvious language barrier, post an image/drawing showing the before and after result. Here i have attached one image....i am selecting one line means its need to measure from center and which side near of end(or Start) that side block should be place..After my selection its need to ask block name.After we r giving block name means irs need to be place..... Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 2, 2010 Share Posted November 2, 2010 [ATTACH]24298[/ATTACH] Here i have attached one image....i am selecting one line means its need to measure from center and which side near of end(or Start) that side block should be place..After my selection its need to ask block name.After we r giving block name means irs need to be place..... Are you also selecting the block to 'insert' at the end/start point? Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 in that time i cannt able chk which one start or which side end...in that time From center its need to consider nearest start(or end) points.... Like i am selecting one line so its consider that nearest start or end of line.... Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 2, 2010 Share Posted November 2, 2010 You can use vlax-curve-getStartPoint and vlax-curve-getEndPoint and sort with vl-sort, based on shortest distance the given point and the end/start point, then just take the first item in the list. eg. (car (vl-sort (list (vlax-curve-getStartPoint <EName>) (vlax-curve-getEndPoint <EName>)) (function (lambda (a b) (< (distance <Point> a) (distance <Point> b)))) ) ) Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 here hw to fix the defun command...???and for block asking? Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted November 2, 2010 Share Posted November 2, 2010 What about just selecting endpoint and rotate? Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 its showing error.; error: An error has occurred inside the *error* functionAutoCAD variable setting rejected: "filletrad" nil.. with comand only we can acess..??other wise we cannt use Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 2, 2010 Share Posted November 2, 2010 You may find these codes helpful . (defun c:THib (/ ss start end e lst answer) ; THARWAT Nov.02.2010 (if (setq ss (car(entsel "\n Select Line :"))) (progn (setq start (cdr (assoc 10 (setq e (entget ss))))) (setq end (cdr (assoc 11 e))) (entmakex (list (cons 0 "INSERT") (cons 2 "[b][color="red"]YourBlockName[/color][/b]") (cons 10 start) )) (setq lst (entlast)) (initget "Yes No") (setq answer (getkword "\n Agree with this side [Yes/No] :")) (if (eq answer "No") (progn (entdel lst) (entmakex (list (cons 0 "INSERT") (cons 2 "[b][color="red"]YourBlockName[/color][/b]") (cons 10 end) (cons 50 3.14159))) ) (princ) ) ) (princ) ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 i have tried...but there is no option for block insert...and one more here Agree with this side i am given no means its deleting mt selected line....So here i want to fix block insert option.which block i am giving that block need to place in nearest start or end of the line.......... Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted November 2, 2010 Share Posted November 2, 2010 Try this, no defun reqired ^C^C-insert;\end;\;;\ It give you option to select closest end and rotation Quote Link to comment Share on other sites More sharing options...
Tharwat Posted November 2, 2010 Share Posted November 2, 2010 Just insert the name of your block , then load the routine . *Codes are updated with name of Block* Tharwat Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 Try this, no defun reqired ^C^C-insert;\end;\;;\ It give you option to select closest end and rotation i want to add this to this codes???where i want to add??this?? Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 2, 2010 Share Posted November 2, 2010 here hw to fix the defun command...???and for block asking?Seriously?!? So, basically, you have no coding experience and you are just wanting handouts. You may find these codes helpful . (defun c:THib (/ ss start end e lst answer) ; THARWAT Nov.02.2010 (if (setq ss (car(entsel "\n Select Line :"))) (progn (setq start (cdr (assoc 10 (setq e (entget ss))))) (setq end (cdr (assoc 11 e))) (entmakex (list (cons 0 "INSERT") (cons 2 "[b][color=red]YourBlockName[/color][/b]") (cons 10 start) )) (setq lst (entlast)) (initget "Yes No") (setq answer (getkword "\n Agree with this side [Yes/No] :")) (if (eq answer "No") (progn (entdel lst) (entmakex (list (cons 0 "INSERT") (cons 2 "[b][color=red]YourBlockName[/color][/b]") (cons 10 end) (cons 50 3.14159))) ) (princ) ) ) (princ) ) ) Tharwat You can save some headache by just entmod'ing the insertion point instead of deleting and recreating. Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted November 2, 2010 Share Posted November 2, 2010 Button...... Create new button, add above macro to it and use. Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted November 2, 2010 Share Posted November 2, 2010 Alan, read post #8 http://www.cadtutor.net/forum/showthread.php?53966-pipe-placing Quote Link to comment Share on other sites More sharing options...
Guest cad2007 Posted November 2, 2010 Share Posted November 2, 2010 i have tried..its placinfg the block to line start only...please try once..i want to nears(start or end)as per the selection.... Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted November 2, 2010 Share Posted November 2, 2010 How close to endpoint is nears? Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 2, 2010 Share Posted November 2, 2010 Alan, read post #8 http://www.cadtutor.net/forum/showthread.php?53966-pipe-placing Yeah, seems familiar. 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.