Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/01/2022 in all areas

  1. To add to this once your points are defined then you can create them like so: (foreach p (list u1 u2 u3 u4) (entmake (list '(0 . "POINT") (cons 10 p))))
    2 points
  2. Another - (defun f ( l / r ) (foreach x l (or (assoc (car x) r) (setq r (cons x r)))) (reverse r) )
    2 points
  3. Since DXF group 70 is bit coded, you should use a bitwise filter for the test, e.g.: (setq ssvalid (ssget "_X" (list (cons 8 validlistlayers) (cons 0 validlisttype) '(-4 . "&=") '(70 . 1)))) The use of the bitwise filter &= is equivalent to: (= 1 (logand 1 (cdr (assoc 70 <dxf data>)))) You can find more information about the bitwise masked equals operator in my ssget reference here. The reason that your original code is failing is because you have included two values for DXF group 70 in your filter list, and all items in the filter list have an implied AND logic - as such, this filter will never select any objects, as DXF group 70 cannot be both 1 and 129.
    2 points
  4. It depends on what data the OP is looking to obtain from the entity, i.e. whether the data pertains to the block reference or the block definition; the suggestion from @mhupp is obtaining data from the block definition, whereas the code from the OP is obtaining data from the block reference.
    2 points
  5. OK, the stringp error tells us that the variable is not a string that the LISP is happy with, most often for me it is because I am trying to use a number and not a string, the next option could be that it is a list you are trying to use .... which kind of makes sense with the brackets, try either (setq Cmd (car (LM:listbox "Select an Item" '("IFCALL" "FWRALL" "REVB" "REV1" "IFRDEF") 1))) or this line after your setq Cmd line: (setq cmd (car Cmd)) see what happens there
    2 points
  6. missing a ' (foreach p (list u1 u2 u3 u4) (entmake (list '(0 . "POINT") (cons 10 p))))
    1 point
  7. Are you applying a value to d? also you don't need the 2nd "" this repeats the last command and probably where you error is coming from. (command "_POINT" u1) I try an not use "(command" When I can. entmake is a little more code but less chance of error and is also much faster. (setq u1 (list 0 0)) (entmake (list (cons 0 "POINT") (cons 10 u1) ) ) y
    1 point
  8. This is pulling entget data from the first item in the selection set. What I mean is the entity will be random because their is a change for both the blocks to be first. That seem like it might cause more errors depending on what your lisp is doing. This will always be BLOCK1 entget data (setq LEnt (entget (tblobjname "BLOCK" "BLOCK1")))
    1 point
  9. Perfect. Thank you very much!
    1 point
  10. You should be able to use a dotted list item in there, In your ssget you are looking for anything that has a dxf 70 of 1 AND 129, would you want this to be OR ? Lee Mac has a good reference, http://lee-mac.com/ssget.html looking at both the AND and OR descriptions should show the syntax to use.
    1 point
  11. Hi. For exemple, the following will only select polylines (heavy/light) that are closed in the current space (object/paper). (while (null (setq ss (ssget (list '(0 . "*POLYLINE") '(-4 . "<AND") '(-4 . "<NOT") '(-4 . "&") '(70 . 120) '(-4 . "NOT>") '(-4 . "&") '(70 . 1) '(-4 . "AND>") (cons 67 (if (eq (getvar "CVPORT") 1) 1 0)) (cons 410 (if (eq (getvar "CVPORT") 1) (getvar "CTAB") "Model")) ) ) ) ) )
    1 point
  12. this is a possibility (defun elimina ( l ) (if l (cons (car l) (elimina (vl-remove-if '(lambda ( x ) (= (caar l) (car x))) (cdr l))))) )
    1 point
  13. This came up the other day: ;;https://www.cadtutor.net/forum/topic/76207-send-a-text-message-by-whatsapp/ (defun open_url_in_chrome (url / sa);by ronjonp (and (setq sa (vlax-get-or-create-object "Shell.Application")) (null (vlax-invoke sa 'shellexecute "chrome.exe" url)) (vlax-release-object sa) ) ) You can put in the 'exe' name ( msedge.exe in this case ), or like MHUPP says will also do _browser for the default browser, a slightly different method to yours and I don't know if the interface will work as you want but it looks like it might
    1 point
  14. Don't know what your trying to do but if edge is set as your default you can just use the command browser to launch. (command "_.Browser" "www.google.com")
    1 point
×
×
  • Create New...