Jump to content

problem with zoom


rodrigo_sjc_sp

Recommended Posts

i have the code

 

(setq i 0) 
(repeat (sslength selpline)
     (setq pline_ent (ssname selpline i))            
     (setq lis_ent (entget pline_ent))
     (setq j 0)
     (setq b 0)
     (setq lis_coords '())   
     (repeat (length lis_ent)
           (if (= (car (nth j lis_ent)) 10)
               (setq lis_coords (append lis_coords (list (cdr (nth j lis_ent)))))
           )      
           (setq j (+ j 1))
      )
     (print "001")
     (setq selec (ssget "wp" lis_coords))
     (print "002")
     (repeat (sslength selec)    
     (print "003")
     (setq entblk (ssname selec b))   
     (print "004")
     (setq tipo_l (cdr(assoc 0 (entget entblk))))
     (print "005")

 

 

If i use zoom out the command is ok , run at (print 005)

 

BUT , if i use zoom in the command stop in "002"

Specify stretch point or [base point/Copy/Undo/eXit]:1 found

"001"

"002" ; error: bad argument type: lselsetp nil

 

And the error is in the line

(repeat (sslength selec)

 

 

And the message request Select Object is showed

 

Any Help ?

Link to comment
Share on other sites

Hi Rodrigo, to use ssget with the graphic window selection modes (C, CP, F, W, WP) the specified area should be visible on the screen, so it would be wiser to use a zoom extents before. Or maybe if the drawing is too big you could do a zoom window to the extents of the selected polyline.

You could use in this case the boundingbox of that entity:

(vla-GetBoundingBox (vlax-ename->vla-object (car (entsel))) 'pmin 'pmax)
(vla-zoomwindow (vlax-get-acad-object) pmin pmax)

Link to comment
Share on other sites

  • 2 weeks later...

Reinaldo, your tip helped me.

If the polyline is not showing the whole screen, it returns null.

 

Resolved using zoom

 

Thanks to all (reinaldo and pBe!)

Edited by rodrigo_sjc_sp
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...