Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/04/2025 in Posts

  1. (defun c:foo (/ ss selPt obj startPt endPt pt1) (while (not ss) (setq ss (ssget "_+.:E:S" '((0 . "LINE")))) ) (setq selPt (trans (cadr (nth 3 (car (ssnamex ss 0)))) 0 2)) ; get point of selection (setq obj (vlax-ename->vla-object (ssname ss 0))) (setq startPt (reverse (cdr (reverse (trans (vlax-curve-getStartPoint obj) 0 2))))) (setq endPt (reverse (cdr (reverse (trans (vlax-curve-getEndPoint obj) 0 2))))) ;; Determine closer endpoint (if (< (distance selPt startPt) (distance selPt endPt)) (setq pt1 startPt) (setq pt1 endPt) ) (vla-put-color (vla-addcircle (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3d-point (trans pt1 2 0)) 10) acRed) ;circle for testing ) Hi EnM4st3r, Try the edited code above if it works for you.
    2 points
  2. This is where I started there is info out there but a bit hard to find. The zip has lisp and vba example it is just in one file for my convenience as I cut and paste from it. https://www.cadtutor.net/forum/topic/79565-autocad-use-libreoffice-instead-of-excel/page/3/ Get and Put data into Libreoffice Calc — BricsCAD Forum https://forum.bricsys.com/discussion/38699/get-and-put-data-into-libreoffice-calc?utm_source=community-search&utm_medium=organic-search&utm_term=libre Look at Tim_n post. The main thing is start here. (setq oServiceManager (vlax-get-or-create-object "com.sun.star.ServiceManager")) Best to reply to my original post rather than here. Put back into my To do list. Libre.zip
    2 points
  3. Circles are planar entities and defined relative to the OCS.
    1 point
  4. Nice. It only placed them visually tough, not on the exact endpoints. I changed it a little, seems to work now. (defun c:foo (/ ss selPt obj pt1 pt2) (while (not ss) (setq ss (ssget "_+.:E:S" '((0 . "LINE")))) ) (setq selPt (trans (cadr (nth 3 (car (ssnamex ss 0)))) 0 2)) ; get point of selection (setq obj (vlax-ename->vla-object (ssname ss 0))) (setq pt1 (vlax-curve-getStartPoint obj)) (setq pt2 (vlax-curve-getEndPoint obj)) ;; Determine closer endpoint (if (< (distance selPt (reverse (cdr (reverse (trans pt2 0 2))))) (distance selPt (reverse (cdr (reverse (trans pt1 0 2))))) ) (setq pt1 pt2) ) (vla-put-color (vla-addcircle (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) (vlax-3d-point pt1) 10) acRed) ;circle for testing )
    1 point
  5. This would be my front end can have up to about 20 choices, see multi toggles. Just having a think how make a command from a string etc maybe a Eval or read. This worked. (setq str (list "circle" "0,0" "10")) (foreach val str (command val)) You do a foreach of the ans and look is it a "1" meaning you have selected that item. So run that command. Multi toggles.lsp
    1 point
  6. Loft has a Path option. Select the square, then select the circle. Hit Enter and then choose the "Path" option and then choose your arc.
    1 point
  7. @Jojo Try this: (prompt "\nTo run LISP type: MCODIST") (defun c:MCODIST ( / old_copyMode old_osmode copyEntity basePoint side sign old_nomutt ss len i data position_+ stringOne stringTwo stringConcate) (setq old_copyMode (getvar 'copymode) old_osmode (getvar 'osmode) ) (setvar 'copymode 1) (setq copyEntity (car (entsel "\nPick the copy entity:")) basePoint (getpoint "\nPick the base point:") ) (initget 1 "Left Right") (setq side (getkword "\nChoose side for copy [Left/Right]:")) (if (= side "Left") (setq sign -) (setq sign +) ) (setq old_nomutt (getvar 'nomutt)) (setvar 'nomutt 1) (princ "Select all Text entities:") (setq ss (ssget '((0 . "*TEXT"))) len (sslength ss) i 0 ) (setvar 'nomutt old_nomutt) (setvar 'osmode 0) (while (< i len) (setq data (cdr (assoc 1 (entget (ssname ss i)))) position_+ (vl-string-position (ascii "+") data) ) (if (/= position_+ nil) (progn (setq stringOne (substr data 1 position_+) stringTwo (substr data (+ position_+ 2) (strlen data)) stringConcate (strcat stringOne stringTwo) ) (command-s "_copy" copyEntity "" basePoint (list (sign (car basePoint) (atof stringConcate)) (cadr basePoint) (caddr basePoint))) ) ) (setq i (1+ i)) ) (setvar 'copymode old_copyMode) (setvar 'osmode old_osmode) (prompt (strcat "\nThe entity was copied " (itoa len) " times!")) (princ) ) bandicam 2025-02-01 10-08-33-989.mp4 Best regards.
    1 point
  8. YES it's as simple as that... You may also want to explore on the "Current View" only option.
    1 point
  9. have you solve this? What you can do is create a New Type (click the button mark with Red rectangle and assign a new name ( Marked in yellow Rectangle in my case. Click on the panel that you need to assign the glass material and create a new Parameter for the inside Panel so you can assign a separate material for that. To do that you need to click the red circle in the image below :. Associate a New Parameter by clicking the encircle button Assign a parameter name , in this case I use Inside Panel. Once done, you can assign a separate material for your inside Panel (Glass) and your Panel Material (aluminum) Sorry my screen recording app is not working so I just use screenshots. Post if you still have concerns...
    1 point
×
×
  • Create New...