ibr_ozdemir Posted January 28, 2009 Posted January 28, 2009 hi everyone, i was wondering if is there any lisp code to lock drawing in AutoCAD it could be like that : (defun c:SomeThingsToDo() (LockDrawing) (DoSomeThings) ;which contains many drawing proccess (UnLockDrawing) ) i think it could do major speedup on my lisp program thanks Quote
ReMark Posted January 28, 2009 Posted January 28, 2009 I think any gain in speed would be negligible unless you're working on a 386-25MHz computer. In which case I'd say it's time to buy a new computer. What kinds of drawings do you work with? How large is a typical drawing file? What "things" would you be doing while the drawing is locked? Doesn't locking and unlocking the drawing take time just as well? Would the time these actions take be offset to any great degree by what is accomplished inbetween issuing these two commands? Quote
ibr_ozdemir Posted January 28, 2009 Author Posted January 28, 2009 thanks for quick reply when we use any code include "(Command)" (for example (Command "ucs" "w")) AutoCAD draws the whole scene and we know that autocad has its own drawing engine (not any others like opengl or direct3d) so it takes a lot of time and i design ships so they have a lot of objects (some times our files size are being over 150 mb) anyway let say average fps (frame per second) is 20 on a big project file so a lisp function is gonna use a lot of "command" code like 100 thousand or something so it takes 83 minutes useless drawing. 83 minutes is a huge time for wasting and you said "Doesn't locking and unlocking the drawing take time just as well? Would the time these actions take be offset to any great degree by what is accomplished inbetween issuing these two commands?" i dont mean locking every one of object indivudualy, i'm asking is there a locking code just blocking drawing thats all thanks Quote
bagulhodoido Posted January 28, 2009 Posted January 28, 2009 Hmm... This probably not what you are looking for, but this is a locking lisp. Used to lockup drawings to kind of protect them on the copyright issues and stuff... Haven't explored all of it, but maybe you might find a way to work with it... Btw, I don't know the author... Btw, Hidding layers, freezing or locking them up them do make the whole thing smoother, when I'm dealing with large files with complex drawing I use the layer management a lot. You probably know about this, but freezing the whole drawing or locking all the layers can be done just going in layer managemente hitting select all and clickin on the locking icon, maybe the freezing, w/e. 8D hope I could help you somehow ---- EDIT ---- AHHH, just to mention, ALWAY, I repeat, ALWAYS, save a backup of your drawing before using this lisp even the drawing being 150 mb large. hehe Like, save a backup, open one of them, the original or the backup which would pretty much be the same, and lock ONE of them, that one will be locked from now on if you save it that way. And I believe there's no going back from that point for the locked up drawing. Lockup.lsp Quote
ibr_ozdemir Posted January 28, 2009 Author Posted January 28, 2009 by the way when i'm saying drawing i dont mean the file, i mean process of scene (viewport) drawing Quote
ibr_ozdemir Posted January 28, 2009 Author Posted January 28, 2009 thanks, i think your way is the only way for speedup unless autolisp doesnt have any kind of easy way if i cant find any easy solution i will develop a freez unfreez manager anyway and thanks for the advice Quote
dbroada Posted January 28, 2009 Posted January 28, 2009 does your LISP have to contain command expressions? Its a long time since I wrote any LISP but I don't remember using command very often. Maybe one of the code gurus can put me right. Quote
ibr_ozdemir Posted January 28, 2009 Author Posted January 28, 2009 well for example you have to do some calculates with points of every objects in your file, you have to use "trans" command for transformation in world coordinate system you gotta use (command "ucs" "en" NextObject) and (command "ucs" "w") or you may want to draw some polyline so you gotta use (command NextPoint) for ever y point on polyline ofcourse after the (command "pline") or you may want to move things so you use : (command "move" TheObject) (command "") (command (list 0 0 0)) (command (list moveX moveY moveZ)) maybe there are other ways to do these kind of things for example (entmod) (entupd) but i tghought maybe i could use block drawing and skim with easy ways Quote
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.