Tomislav Posted February 8, 2014 Share Posted February 8, 2014 hi is there a way to get point that i got from getpoint function in selection set? i tried like this : (setq pnt(ssadd)) (while(setq pntx(getpoint"\nSelect points from the LEFT to RIGHT : ")) ;(setq pntx(entget(entlast))) ;first way (ssadd pntx pnt) ;second way ) thanx Quote Link to comment Share on other sites More sharing options...
GP_ Posted February 8, 2014 Share Posted February 8, 2014 (setq pnt nil) (while (setq pntx (getpoint"\nSelect points from the LEFT to RIGHT : ")) (setq pnt (cons pntx pnt)) ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 8, 2014 Share Posted February 8, 2014 Hi , The ssadd function is to add entity to a selection set but in your case you need to have a list of coordinate points , so here it goes like this . (while (setq pntx (getpoint "\n Select points from the LEFT to RIGHT : ")) (setq lst (cons pntx lst)) ) So the variable lst has all picked points from the user . Quote Link to comment Share on other sites More sharing options...
Tomislav Posted February 8, 2014 Author Share Posted February 8, 2014 that works,thanx...only thing is , i need to convert the rest of my code to handle list and not ss that's why i tried to get them in ss Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 8, 2014 Share Posted February 8, 2014 What you are after with your codes Tom ? Quote Link to comment Share on other sites More sharing options...
Tomislav Posted February 8, 2014 Author Share Posted February 8, 2014 i'm writing sort of cross section drawing lisp and i wrote it completely on ss basis, just while debugging i found that this way wan't go via getpoint... i can use this: (princ "\nSelect points from the LEFT to RIGHT : ") (setq pnt (ssget ":E"'((0 . "POINT")))) but then i need to zoom to every point(because of picbox) to select it while with getpoint i just set the osnap to point and 'click away' Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 8, 2014 Share Posted February 8, 2014 Are you drafting a cross section from points that already existed in a drawing ? Can you upload a sample drawing show before and after ? Quote Link to comment Share on other sites More sharing options...
Tomislav Posted February 9, 2014 Author Share Posted February 9, 2014 here is the sample...i've surveyed the road on stations like you see in .dwg and via this lisp i want to create cross sections or profiles of the road selecting desired points(on left side in dwg) and place them on desired cross section and fill data in table (on right side in dwg)... right now i'm doing it with CadTools, and although it has more options, i can't select a profile and table to place the data directly on it and it does not fill the table, but rather i must copy/paste data that CadTools creates which takes some extra time... sample: SAMPLE.dwg Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 9, 2014 Share Posted February 9, 2014 I am lost with all these sections so just bring the points you want to get their coordinates and where to add them as I have understood from your previous reply . Quote Link to comment Share on other sites More sharing options...
Tomislav Posted February 9, 2014 Author Share Posted February 9, 2014 take for example any station on the road and you'll see three yellow points...they all have elevation and there's major feature line or axis along the middle of the road...the goal is to select points on one station(in this case 3 points but sometimes it could be more or less) ,then to add them profiled like polyline on any desired section on the right and to have heights entered in desired row in table...and in that section they must be entered relative to the road feature line or axis ....i almost done it just need now to convert the lisp to use list instead of ss and i'm not sure how to create polyline from list of points except in command bar? Quote Link to comment Share on other sites More sharing options...
Tomislav Posted February 10, 2014 Author Share Posted February 10, 2014 can someone help me why do i get error : Invalid complex object.bad argument type: stringp nil in this part of code (while (setq pntx (getpoint"\nSelect points from the LEFT to RIGHT : ")) (setq pnt (cons pntx pnt)) ) (setq fpnt(last pnt)) (setq fdistbp(sqrt (+ (expt (- (car bp)(car fpnt)) 2)(expt (- (cadr bp)(cadr fpnt)) 2)))) (princ "\nSelect insertation point on H = ") (princ (float toppt)) (setq inspt(getpoint)) (entmake '( (0 . "POLYLINE") ; Object type (66 . 1))) (setq n 0) (setq pnt(reverse pnt)) (repeat (length pnt) (setq ent (nth n pnt)) (setq y (car ent)) (setq x (cadr ent)) (setq z (caddr ent)) (setq fdistpnt(sqrt(+ (expt(- (car fpnt)y)2)(expt(- (cadr fpnt)x)2)))) (setq hdist(sqrt (+ (expt (- (car bp) y) 2) (expt (- (cadr bp) x) 2)))) ;računa udaljenost od točke profila do bp (setq vdist(- (caddr bp) z)) (if ( (setq ypt(+(car inspt) hdist)) (setq ypt(-(car inspt) hdist)) ) (setq xpt(-(+(cadr inspt)differ) vdist)) (setq vpt (list ypt xpt 0.000)) (entmake (list '(0 . "VERTEX") ; Object type (cons 10 vpt))) (if (or(= table "y")(= table "Y")) (progn (setq xtext(- xpt(- z(- chartlow (- row 0.5))))) (setq textpos(list ypt xtext 0.000)) (command "text" "j" "bc" textpos "90" (rtos z 2 3)) ;(grdraw (list ypt (- xtext 0.5))(list ypt (+ xtext 0.5))2) (princ) ) ) ;(setq count (1+ count)) (if (> fdistbp fdistpnt) (setq hdist(* hdist -1))) (setq ftextdist(strcat ftextdist(rtos hdist 2 3)"\t")) (setq ftextv(strcat ftextv (rtos z 2 3) "\t")) ) (entmake '((0 . "SEQEND"))) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 11, 2014 Share Posted February 11, 2014 Read code posting guidelines Use Vlide run code then use inspect or break on error to find where its stopping, DEBUG Break on error then Last break source 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.