Jump to content

getpoint to ss


Tomislav

Recommended Posts

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

Link to comment
Share on other sites

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 .

:)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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'

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

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