Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/08/2025 in all areas

  1. 2012年的发的文章,时隔13年居然依旧是互联网上延曲线填充唯一的解决方案,谢谢!伟大无需多言。 现在已经是2025年了,应该不用我翻译成英文回帖子了 表达一下感谢
    2 points
  2. Hi @Engineer_Yasser, I agree with @ronjonp, i'v tried many option to choose the true "right" side from to block (which I also don't know where it is), but, after all I made something (which "I hope") that will help you for this situation (or even help to someone to improve this code or even made a new one). Try the following: ; ************************************************************************ ; Functions : CHCOLPL ; Description : Change the colors of the Polylines into the yellow ; Author : SAXLLE ; Date : January 08, 2025 ; ************************************************************************ (defun c:CHCOLPL ( / ss len i ssn ename ent_pl data spt ept 2ndpt 3rdpt midpt lenn tlen k) (setq ss (ssget "X" '((0 . "INSERT") (8 . "BLK") (2 . "blll"))) len (sslength ss) i 0 ) (while (< i len) (setq ssn nil) (setq ename (ssname ss i)) (command-s "_explode" ename "") (setq ent_pl (ssget "x" '((0 . "LWPOLYLINE") (8 . "BLK") (62 . 1) (70 . 1))) data (entget (ssname ent_pl 0)) spt (cdr (nth 15 data)) 2ndpt (cdr (nth 20 data)) 3rdpt (cdr (nth 25 data)) ept (cdr (nth 30 data)) midpt (polar spt (angle spt ept) (/ (distance spt ept) 2)) ) (command-s "_undo" 1 "") (setq ssn (ssget "_F" (list spt ept) '((0 . "LWPOLYLINE") (8 . "Poly"))) lenn (sslength ssn) ) (if (= lenn 1) (setq k 0) (setq k 1) ) (setq tlen (vlax-get-property (vlax-ename->vla-object (ssname ssn 0)) 'Length)) (while (< k lenn) (if (< tlen (vlax-get-property (vlax-ename->vla-object (ssname ssn k)) 'Length)) (progn (setq tlen (vlax-get-property (vlax-ename->vla-object (ssname ssn k)) 'Length) sssn (ssname ssn k) ) ) (progn (setq sssn (ssname ssn k)) ) ) (setq k (1+ k)) ) (setq eptn (vlax-curve-getEndPoint (vlax-ename->vla-object sssn))) (if (> (cadr midpt) (cadr eptn)) (progn (setq ssn (ssget "_F" (list spt ept) '((0 . "LWPOLYLINE") (8 . "Poly")))) (command-s "_chprop" ssn "" "c" 2 "") ) (progn (setq ssn (ssget "_F" (list 2ndpt 3rdpt) '((0 . "LWPOLYLINE") (8 . "Poly"))) lenn (sslength ssn) ) (if (= lenn 1) (setq k 0) (setq k 1) ) (setq tlen (vlax-get-property (vlax-ename->vla-object (ssname ssn 0)) 'Length)) (while (< k lenn) (if (< tlen (vlax-get-property (vlax-ename->vla-object (ssname ssn k)) 'Length)) (progn (setq tlen (vlax-get-property (vlax-ename->vla-object (ssname ssn k)) 'Length) sssn (ssname ssn k) ) ) (progn (setq sssn (ssname ssn k)) ) ) (setq k (1+ k)) ) (setq midpt (polar 2ndpt (angle 2ndpt 3rdpt) (/ (distance 2ndpt 3rdpt) 2))) (setq eptn (vlax-curve-getEndPoint (vlax-ename->vla-object sssn))) (setq ssn (ssget "_F" (list midpt eptn) '((0 . "LWPOLYLINE") (8 . "Poly")))) (command-s "_chprop" ssn "" "c" 2 "") ) ) (setq i (1+ i)) ) (princ) ) From the attached picture, I can't change the color of polylines into the yellow from the blue "circle" (it changed the color from the "wrong" side).
    1 point
  3. Well that's pretty easy to do. 'Right' is not orientation but one or the other. The code below will select the side with the smallest cumulative length ( because I'm a dork ). Enjoy (defun c:foo (/ a b c fz bks p s x) ;; RJP » 2025-01-08 (cond ((and (setq s (ssget "_X" '((0 . "INSERT") (2 . "blll")))) (setq bks (mapcar 'cadr (ssnamex s))) (setq s (ssget "_X" '((0 . "LWPOLYLINE") (8 . "Poly")))) (setq s (mapcar 'cadr (ssnamex s))) ) (setq s (mapcar '(lambda (x) ;; Startpoint, length, startangle, ename (list (setq p (vlax-curve-getstartpoint x)) (vlax-curve-getdistatpoint x (vlax-curve-getendpoint x)) (angle '(0 0 0) (vlax-curve-getfirstderiv x (vlax-curve-getparamatpoint x p))) x ) ) s ) ) (setq fz 2) (foreach p (mapcar '(lambda (x) (cdr (assoc 10 (entget x)))) bks) (and (setq a (vl-remove-if-not '(lambda (x) (equal p (car x) fz)) s)) (setq b (vl-remove-if-not '(lambda (x) (equal (caddr (car a)) (caddr x) fz)) a)) (setq c (vl-remove-if '(lambda (x) (equal (caddr (car a)) (caddr x) fz)) a)) (foreach e (if (< (apply '+ (mapcar 'cadr b)) (apply '+ (mapcar 'cadr c))) b c ) (entmod (append (entget (last e)) '((8 . "SHORTSTACK") (420 . 16711680)))) ) ) ) ) ) (princ) )
    1 point
  4. yeah, got it already. anyways, you had suggested a revised code a bit shorter and it worked for me. thanks!
    1 point
  5. @NanGlase Not talking about your code, but how you post code into this forum. See Nikon's example above.
    1 point
  6. Step 1 Step 2 It will look like this: Paste your text from notepad++
    1 point
  7. Country by Country - Mainly FREE Events. http://www.autodesk.co.uk/adsk/servlet/event/search?siteID=452932&id=6664037 UK Based FREE Events http://www.imass-ids.co.uk/news/EventsCalendar.php See you at the Glasgow IV 2008 launch in June. Nick
    1 point
  8. Hi Matthew If you have a 2D plan of the site then 1- make sure all areas are closed plines and not lines - Once imported in 3dsMax you can extrude the closed shapes into 3D form and build your model 2- make sure you set the scale correct BEFORE importing your drawing into Max 3- In AutoCAD move your drawing to 0,0,0 and delete what is not needed - remove lines/objects far away from 0,0,0 4- import your CAD file into Max There are so many tutorials about this on Youtube - A decent and good tutorial is called "Creating an Optimized Architectural Visualization" - you may find it on youtube - it will show you the whole process from start to finish Regards Adsk
    1 point
  9. You can also enable 'Snaps' and set your Snap option to 'Grid Points'. Then set your 'Grid Dimensions' to whatever you need for your project. Make sure the Grid is displayed in your viewport and now you can draw straight lines which snap to the points on your grid.
    1 point
  10. Hi,GP,Thanks for your wonderful routine. I have some improvement for you code,It fix some BUG for hatch line is too long. AlignH.lsp
    1 point
×
×
  • Create New...