Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/21/2021 in all areas

  1. If it was just one drawing I would do the usual purge, audits and so on and like mhupp just copy to a new drawing and replace the bad one, you can also wblock the drawing which is a common solution. Creating a LISP for just one drawing is a bit of overkill unless someone has something already written. Remember to select the objects mouse top left to bottom right and not the other way else you might still get these rogue objects. If not you can look into the blocks you want to keep, there might be one of them that references these 'ghost' elements, - could try delete the block, purge and insert a new version ... but for a one off drawing writing and checking a LISP routine sounds like a lot of work
    2 points
  2. This lisp basically does what you want. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/chamfer-2-0/td-p/10822529 (defun c:chd (/ spm dc ss s1 s2 pins c pc1 pc2) (vl-load-com) (setq spm (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object)))) (setq dc (getreal "\nEnter Chamfer distance: ")) (setq ss (ssget)) (if (= (sslength ss) 2) (progn (setq s1 (vlax-ename->vla-object (ssname ss 0))) (setq s2 (vlax-ename->vla-object (ssname ss 1))) (setq pin (vla-intersectwith s1 s2 acextendnone)) (setq cc (vla-addcircle spm pin dc)) (setq pc1 (vla-intersectwith cc s1 acextendnone)) (setq pc2 (vla-intersectwith cc s2 acextendnone)) (vla-erase cc) (vla-addline spm pc1 pc2) (setq line (entlast)) ;trim from line ? ) (prompt "\nOnly pick two objects") ) )
    1 point
  3. Make sure all layers are on, thawed, and unlocked. run audit then purge. See if you have any nested blocks that have a reference in them. Still there ? might just be easier to start a new drawing and copy things over. with the help of steal
    1 point
  4. Thank you MHupp. Tha ;;----------------------------------------------------------------------------;; ;; Select Similar Objects & isolate shortcut (defun C:SSO () (if (setq SS (ssget)) (progn (command "_.Selectsimilar" SS "") (command "_.isolateobjects") ;no need for "P" objects are already highlighted from previous command. ) (command "_.unisolateobjects") ) (princ) ) t is what i was tryin to get to work.
    1 point
  5. Time to start learning some code, this is quite easy so a good start for you.. and google is also your friend. So in BigAls example he has a couple of lines asking for ht adjustment, something like this "(setq v2 (getreal "\nEnter ht adjustment "))" and I reckon that they are the lines to look at changing. An internet search might give you this to try: (setq v2 (vla-get-TextString (vlax-ename->vla-object (car (entsel))))) Note from experience that this line doesn't have any text to tell the user what it is expecting, you might try something like (princ "zzzz") just before this line to tell the user what to do, and you might get an error that your new V2 is seen as a text string rather than a number, again you can look at Google to see what it says to fix that... it is all out there... (for string to integer maybe try (type v2) to show what it is and then a search if that result is STR what to do... (if (= 'STR (type v2))(princ "String")(princ "Number")).. and then just change the 2 princ commands to what you need it to do). There I reckon that should be enough to give you some thinking but also a solution Much nicer way of asking and you get better help if you can have a go and then ask "I have tried these changes but it isn't quite working"
    1 point
  6. No need for ssget just type ss to run command. Sorry didn't see you wanted to isolate objects. Select objects and similar objects will be isolated select nothing to unhide all hidden objects. ;;----------------------------------------------------------------------------;; ;; Select Similar Objects & isolate shortcut (defun C:SSO () (if (setq SS (ssget)) (progn (command "_.Selectsimilar" SS "") (command "_.isolate") ;no need for "P" objects are already highlighted from previous command. ) (command "_.unisolate") ) (princ) )
    1 point
  7. Start with two views of the paddleboard and create a region from a spline for half of the top (or bottom) view and the full side view. Extrude the two regions and rotate the profile solid so that it intersects the extruded top view. Execute a Boolean intersect. to get half of the board then mirror and union to get a single solid of the board.
    1 point
  8. @Mesut Your lisp computes all distances but because mes keeps getting reset it will only have the distance of the last two points. You can get dist from 3d points. your two points dist = 30.67 The error you getting is due to a bad while lets say you have 3 points in your noks selection set ssname noks 0 ssname noks 1 ssname noks 2 first pass counter = 0 dist noks 0 & noks 1 counter = 1 dist noks 1 & noks 2 counter = 2 dist noks 2 & noks 3 error because noks 3 doesn't exist update while to (while (< counter (- len 1)) or (repeat (- len 1) -edit- (defun c:ucg (/ noks kord1 kord2 mes c len) (setq noks (ssget '((0 . "POINT")))) (if (<= (setq len (sslength noks)) 1) ;need a minimum of two points (prompt "\nNot Enought Points Selected") (progn (setq c 0) (repeat (- len 1) (setq txtdata (entget (ssname noks c)) txtdata1 (entget (ssname noks (setq c (+ c 1)))) kord1 (cdr (assoc 10 txtdata)) kord2 (cdr (assoc 10 txtdata1)) mes (distance kord1 kord2) ) (prompt (strcat "\nDistance : " (rtos mes 2))) ;don't know what your doing with mes but this will display it. ) ) ) (princ) )
    1 point
  9. Tharwat you dont need add or subtract as a option a negative value implies when added to a number to subtract anyway. Hence the wording enter height adjustment. Just realised a simple problem in the code posted including mine need a extra question decimal places required set it say at a default value so can do a enter for default. 0 1 2 3 . Also does the code need to be able to change the FL=90.36 to FL=90.06 this can be done quite easily as a variation on the code's posted thanks to Lee's parse number lisp. Heres a double version pick pick etc or multi pick an oldy quite a few years ago ; Adds a fixed amount to a number ;(PRINC "\nTO USE JUST TYPE A2L or A2LM for multiple ") (Alert "TO USE JUST TYPE A2L or A2LM for multiple ") ;(setvar "cmdecho" 1) (setq olddimzin (getvar "Dimzin")) (setvar "dimzin" 0) (DEFUN c:A2L () (setq v2 (getreal "\nEnter ht adjustment ")) (setq test 1) (while (= test 1) (setq en1 (car (entsel "\nSelect text number:" ))) (if (/= en1 nil) (progn (setq el1 (entget en1)) (setq v1 (atof (cdr (assoc 1 el1)))) (setq a (+ v1 v2)) (setq b (rtos a 2 3)) (setq el (subst (cons 1 b) (assoc 1 el1) el1)) (entmod el) ; (entupd en1) );progn (princ "\nplease pick again"); else );if ); while true (setq el nil) (setq en nil) (setq a nil) (setq v1 nil) (setvar "cmdecho" 1) (setvar "dimzin" olddimzin) (princ) ); END a2l DEFUN (defun c:A2LM () (setq v2 (getreal "\nEnter ht adjustment ")) (setq ss (ssget (list (cons 0 "Text")))) (setq len (sslength ss)) (setq x 0) (repeat len (setq en1 (ssname ss x)) (setq el1 (entget en1)) (setq v1 (atof (cdr (assoc 1 el1)))) (setq a (+ v1 v2)) (setq b (rtos a 2 3)) (setq el (subst (cons 1 b) (assoc 1 el1) el1)) (entmod el) (setq x (+ x 1)) ); repeat (setq el nil ss nil) (setq en nil) (setq a nil) (setq v1 nil) (setvar "dimzin" olddimzin) (setvar "cmdecho" 1) (princ) ); END a2lm DEFUN
    1 point
×
×
  • Create New...