Jump to content

Is there a way to “pause” viewport display while running lisp.


HideQ

Recommended Posts

For example lisp is drawing complicated shapes out of individual lines – is there a way to “pause” the display for the duration of the function, so that complete linework just show all at once, instead of each individual line with flickering screen?

 

Many Thanks

Link to comment
Share on other sites

Thanks Lee Mac, I think that is the way to go.

 

I am new to the lisp world and was asking this question for few applications, but currently I am struggling with LISP allowing me to quickly work with point cloud in AutoCad 2016.

 

I am usually working with 3 viewports while modelling, e.g. slicing the cloud from side view and investigating from the top. I was hoping to move the crop of the point cloud up and down, similarly to cloudworx, so I came up with this crude solution:

 

(defun c:crop (/ cor1 cor2); point cloud rectangular crop
 (setq cor1 (getpoint "\nselect first corner:"))
 (setq cor2 (getcorner cor1 "\nselect second corner:"))
 (setq 2dcor1 (list (car cor1) (cadr cor1)))
 (setq 2dcor2 (list (car cor2) (cadr cor2)))
 (setq cloud (ssget "x" '((8 . "Cloud"))))	; point cloud have to be on the "Cloud" layer
 (command "POINTCLOUDCROP" cloud 2dcor1 2dcor2 "inside")
 (setq csd (- (cadr 2dcor2) (cadr 2dcor1)))
 (princ)
)

(defun c:fs () ;forward step
 (setq cloud (ssget "x" '((8 . "Cloud"))))
 (command "POINTCLOUDCROP" cloud "r")
 (setq 2dcor1 (list (car 2dcor1) (+ (cadr 2dcor1) csd)))
 (setq 2dcor2 (list (car 2dcor2) (+ (cadr 2dcor2) csd)))
 (command "POINTCLOUDCROP" cloud 2dcor1 2dcor2 "inside")
 (princ)
)

(defun c:bs () ;backward step
 (setq cloud (ssget "x" '((8 . "Cloud"))))
 (command "POINTCLOUDCROP" cloud "r")
 (setq 2dcor1 (list (car 2dcor1) (- (cadr 2dcor1) csd)))
 (setq 2dcor2 (list (car 2dcor2) (- (cadr 2dcor2) csd)))
 (command "POINTCLOUDCROP" cloud 2dcor1 2dcor2 "inside")
 (princ)
 )
 
(defun c:csd (/ a) ;change the slice step distance
 (setq a (getreal "\nnew cloud slice value:"))
 (setq csd a)
 (princ)
)
(princ)

 

Among many issues with this lisp (work in progress) is the visible removing of the last crop, which can make it hard for examining the scan data. Any guidance on how to work around it or where to look for possible solution? ObjectARX seems to be the option, but it might be a slight overkill from my newbie perspective.

Edited by SLW210
Added Code Tags.
Link to comment
Share on other sites

Hello Dadgad,

 

Thank you for the link.I fell a little guilty, especially since I cannot edit this post :)

 

I will use those guidelines in the future.

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