Jump to content

All Activity

This stream auto-updates

  1. Today
  2. I need to insert the calculation ananylic in specific drawings. If someone check the drawing ,need to know how I do the calculations.Thats why I want to update this code. Thanks
  3. @mhy3sx please upload the sample DWG with a mtext sample Mean while try the lisp file , it will put the area value at each polyline geografic center get area by calculation.dwg get-area.LSP
  4. MeGuinness

    text offset

    using inventor 2023
  5. MeGuinness

    text offset

    hi guys , is there a way to offset text ? i created the letters and then used the extruder command...cut..so to have the letters embossed to a surface, now i need to create the same letters but 4 mm thick that need to be snapped in on the surface embossed slots, i need to reduce the size slightly so the fit in the slots ...im able to offset anything that i created using LINES or Circle but not the letters . any help appreciated. thanx
  6. @mhy3sx Where you need to put area value .
  7. Someone just asked me about this command (BREAKUP) never heard of it, nothing on YT. I found this in the help file.. Is Explode not politically correct?
  8. @CivilTechSource sure thing. I actually figured out the 'misbehavior' based on an earlier response (it was me being stupid of course). I would love to add another grip to this thing to move the magenta part up and down from either the top or the bottom of the magenta, and have the grips 'slide' with the thing. So if I move the magenta part up with the top grip, the bottom grip goes along for the ride. Then if I slide back down with the bottom grip, the top grip goes along for the ride. I've done that EXCEPT after one round of back and forth it started acting wonky so I went back to the single Move. When I say "bottom", I mean the grip that stays at the bottom of the magenta, not the bottom of the overall block where the Basepoint is. Obviously that starts at the same spot if the block has been reset (notice this one has NOT been reset), but once the magenta moves up, I want the Basepoint to stay put and the "bottom" grip to stay at the bottom of magenta. Seems like it should be so easy but I keep not quite getting it right. I'll see if I can find my last attempt before I went back to this single Move version, but this does have the color differentiated. Thank you jack2.dwg
  9. I dont want to insert the calculations in table.I want to insert as mtext. And I want the calculations with the dimension of eatch polygon not by coordinates. Any ideas Thanks
  10. Makes me think of AreaG from GP_: Maybe you can take some inspiration on the calculations in his code?
  11. Can you highlight at a different color what needs to move up please that would help.
  12. I am trying to write a diesel expression that will extract the first part of the drawing file name. Full Drawing File Name: XXX-ZINC-XX-XX-DR-C-01000_S278 Sections First Part: XXX-ZINC-XX-XX-DR-C- My question: Is there a smarter way to extract the first part rather than relaying on the number of characters? If everyone is following the correct naming protocol it would be 20 characters but sometimes you have people instead of -C- they put -CE- so I am wondering is there a way to future proof it. Thank you. $(substr,$(getvar,"dwgname"),1,20)
  13. I have a code to calculate and write the area of close polygons. I want to update the code to support in calculations rectangular parallelepiped. The problem is that in trapezoid calculation is a bug and if i select a rectangular parallelepiped calculate the area as trapezoid. Can someone fix the code? (defun c:areacal ( / AcDoc Space nw_style js nb ent dxf_ent ptlst n old_textsize count app_txt surf cum_area pt_ins val_txt lst_bis l_4d max_d pos pt1 pt2 pt3 d1 d2 h t_spc nw_obj ent_text key label scl ht *error*) (vl-load-com) ; Define error handler (defun *error* (msg) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " msg)) ) (setvar "OSMODE" 9) (mapcar 'setvar '("clayer" "cecolor" "celtype" "celweight") (list "0" "BYLAYER" "BYLAYER" -1)) (if old_textsize (setvar "TEXTSIZE" old_textsize)) (vla-endundomark AcDoc) (princ) ) (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object))) (vla-startundomark AcDoc) (setvar "OSMODE" 0) ; Set scale and text height (setq scl (getvar "useri1")) (setq ht (* 0.003 scl)) ; Create ΚΕΙΜ_Layout layer if it doesn't exist (if (null (tblsearch "LAYER" "ΚΕΙΜ_Layout")) (vlax-put (vla-add (vla-get-layers AcDoc) "ΚΕΙΜ_Layout") 'color 7) ) ; Create ΚΕΙΜ_Layout text style if it doesn't exist (if (null (tblsearch "STYLE" "ΚΕΙΜ_Layout")) (progn (setq nw_style (vla-add (vla-get-textstyles AcDoc) "ΚΕΙΜ_Layout")) (mapcar '(lambda (pr val) (vlax-put nw_style pr val) ) (list 'FontFile 'Height 'ObliqueAngle 'Width 'TextGenerationFlag) (list (strcat (getenv "windir") "\\fonts\\arial.ttf") 0.0 0.0 1.0 0.0) ) ) ) ; Prompt for label prefix (setq label (getstring "\nInsert prefix (π.χ A,B,C..,etc): ")) (if (eq label "") (setq label "E")) ; Select polylines (prompt "\nSelect polylines one by one (press Enter to finish): ") (setq js (ssget '((0 . "LWPOLYLINE") (-4 . "<AND") (-4 . "&") (70 . 1) (-4 . ">") (90 . 2) (-4 . "<") (90 . 5) (-4 . "AND>")))) (if js (progn (repeat (setq nb (sslength js)) (setq ent (ssname js (setq nb (1- nb))) dxf_ent (entget ent) ptlst (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) dxf_ent)) n (length ptlst) ) (if (eq n 4) (if (and (not (equal (rem (angle (car ptlst) (cadr ptlst)) pi) (rem (angle (caddr ptlst) (cadddr ptlst)) pi) 1E-08)) (not (equal (rem (angle (cadr ptlst) (caddr ptlst)) pi) (rem (angle (cadddr ptlst) (car ptlst)) pi) 1E-08)) ) (ssdel ent js) ) ) ) ) ) (cond ((and js (> (sslength js) 0)) (sssetfirst nil js) (initget "Yes No") (if (not (eq (getkword "\n Insert calculations [Yes/No]? <Yes>: ") "No")) (progn (sssetfirst nil nil) (setq old_textsize (getvar "TEXTSIZE") count 0 app_txt "" cum_area 0.0 ) (setvar "TEXTSIZE" ht) ; Process polylines sequentially (0 to n-1) (setq nb 0) (while (< nb (sslength js)) (setq ent (ssname js nb) dxf_ent (entget ent) ptlst (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 10)) dxf_ent)) n (length ptlst) pt_ins (list (/ (apply '+ (mapcar 'car ptlst)) n) (/ (apply '+ (mapcar 'cadr ptlst)) n)) val_txt (if (eq n 3) (progn (setq lst_bis (append (cdr ptlst) (list (car ptlst))) l_4d (mapcar 'distance ptlst lst_bis) max_d (apply 'max l_4d) pos (vl-position max_d l_4d) pt1 (nth pos ptlst) pt2 (nth pos lst_bis) pt3 (car (vl-remove pt2 (vl-remove pt1 ptlst))) d1 (distance pt3 (inters pt1 pt2 pt3 (polar pt3 (+ (angle pt1 pt2) (* pi 0.5)) (distance pt1 pt2)) nil ) ) surf (* (atof (rtos max_d 2 2)) (atof (rtos d1 2 2)) 0.5) cum_area (atof (rtos (+ surf cum_area) 2 3)) ) (strcat label (itoa (setq count (1+ count))) " = " "1/2 x " (rtos max_d 2 2) " x " (rtos d1 2 2) " = " (rtos surf 2 2) " τ.μ.\\P" ) ) (if (and (equal (abs (- (rem (angle (car ptlst) (cadr ptlst)) pi) (rem (angle (car ptlst) (cadddr ptlst)) pi))) (* 0.5 pi) 1E-08) (equal (abs (- (rem (angle (cadr ptlst) (caddr ptlst)) pi) (rem (angle (caddr ptlst) (cadddr ptlst)) pi))) (* 0.5 pi) 1E-08) ) (progn (setq d1 (atof (rtos (distance (car ptlst) (cadr ptlst)) 2 2)) d2 (atof (rtos (distance (cadr ptlst) (caddr ptlst)) 2 2)) surf (atof (rtos (* d1 d2) 2 2)) cum_area (atof (rtos (+ surf cum_area) 2 2)) ) (strcat label (itoa (setq count (1+ count))) " = " (rtos d1 2 2) " x " (rtos d2 2 2) " = " (rtos surf 2 2) " τ.μ.\\P" ) ) (progn (if (equal (rem (angle (car ptlst) (cadr ptlst)) pi) (rem (angle (caddr ptlst) (cadddr ptlst)) pi) 1E-08) (setq d1 (atof (rtos (distance (car ptlst) (cadr ptlst)) 2 2)) d2 (atof (rtos (distance (caddr ptlst) (cadddr ptlst)) 2 2)) h (atof (rtos (distance (car ptlst) (inters (car ptlst) (polar (car ptlst) (+ (angle (car ptlst) (cadr ptlst)) (* 0.5 pi)) 1.0) (caddr ptlst) (cadddr ptlst) nil)) 2 2)) ) (setq d1 (atof (rtos (distance (cadr ptlst) (caddr ptlst)) 2 2)) d2 (atof (rtos (distance (car ptlst) (cadddr ptlst)) 2 2)) h (atof (rtos (distance (cadr ptlst) (inters (cadr ptlst) (polar (cadr ptlst) (+ (angle (cadr ptlst) (caddr ptlst)) (* 0.5 pi)) 1.0) (car ptlst) (cadddr ptlst) nil)) 2 2)) ) ) (setq surf (atof (rtos (* (+ d1 d2) h 0.5) 2 2)) cum_area (atof (rtos (+ surf cum_area) 2 2)) ) (strcat label (itoa (setq count (1+ count))) " = 1/2 x (" (rtos d1 2 2) " + " (rtos d2 2 2) ") x " (rtos h 2 2) " = " (rtos surf 2 2) " τ.μ.\\P" ) ) ) ) app_txt (strcat app_txt val_txt) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") (cons 8 "ΚΕΙΜ_Layout") '(100 . "AcDbText") (cons 10 pt_ins) (cons 40 ht) (cons 1 (strcat label (itoa count))) (cons 50 (angle '(0 0 0) (getvar "UCSXDIR"))) '(41 . 1.0) '(51 . 0.0) (cons 7 "ΚΕΙΜ_Layout") '(71 . 0) '(72 . 1) (cons 11 pt_ins) (assoc 210 dxf_ent) '(100 . "AcDbText") '(73 . 2) ) ) (setq nb (1+ nb)) ) (initget "1 2") (setq t_spc (getkword "\n Insert calculations[1.Modelspace/2.Paperspace]? <1>: ")) (cond ((eq t_spc "2") (vla-put-ActiveSpace AcDoc acPaperSpace) (vla-put-MSpace AcDoc :vlax-false) (setq Space (vla-get-PaperSpace AcDoc)) (setvar "TEXTSIZE" 2.5) ) (T (vla-put-ActiveSpace AcDoc acModelSpace) (if (not (eq (getvar "TILEMODE") 1)) (vla-put-MSpace AcDoc :vlax-true)) (setq Space (vla-get-ModelSpace AcDoc)) (setvar "TEXTSIZE" ht) ) ) (setq nw_obj (vla-addMtext Space (vlax-3d-point (trans (getvar "VIEWCTR") 1 0)) 0.0 (strcat app_txt label "ολ = " (rtos cum_area 2 2) " τ.μ.") ) ) (mapcar '(lambda (pr val) (vlax-put nw_obj pr val) ) (list 'AttachmentPoint 'Height 'DrawingDirection 'StyleName 'Layer 'Rotation) (list 1 (getvar "TEXTSIZE") 5 "ΚΕΙΜ_Layout" "ΚΕΙΜ_Layout" 0.0) ) (setq ent_text (entlast) dxf_ent (entget ent_text) dxf_ent (subst (cons 90 1) (assoc 90 dxf_ent) dxf_ent) dxf_ent (subst (cons 63 255) (assoc 63 dxf_ent) dxf_ent) ) (entmod dxf_ent) (while (and (setq key (grread T 4 0)) (/= (car key) 3)) (cond ((eq (car key) 5) (setq dxf_ent (subst (cons 10 (trans (cadr key) 1 0)) (assoc 10 dxf_ent) dxf_ent)) (entmod dxf_ent) ) ) ) (setvar "TEXTSIZE" old_textsize) ) (T (sssetfirst nil nil) (princ "\nFunction canceled")) ) ) (T (princ "\nSelected items are invalid")) ) ; Reset system variables (mapcar 'setvar '("clayer" "cecolor" "celtype" "celweight") (list "0" "BYLAYER" "BYLAYER" -1)) (setvar "OSMODE" 9) (vla-endundomark AcDoc) (princ) ) Thanks test.dwg
  14. @CivilTechSource I'm looking to Move actually. I'm not really showing the cylinder that well, but the cylinder pokes out the bottom and pushes basically that whole box part upwards. Thank you for checking in on it though!
  15. You should be using Stretch instead of Move. Move will just move your block and it will not extend it as you mentioned. Is this what you are after? jack.dwg
  16. With ARX, you can use Brep or AssocPersSubentIdPE, the later is a bit simpler to use. AssocPersSubentIdPE will get you the faces, edges, and vertices of the solid. In the case of a cuboid, simply get all the edges and map them to a vertex In this example each vertex should be mapped to three edges. You could then build a transformation matrix so you can accurately compute the dimensions. It starts to get a lot harder with more complex shapes. There’s a few threads at the swamp discussing ideas how to work with I-beams, how to find the edge the run along the length for reference import traceback from pyrx import Ap, Ax, Ge, Ed, Db, command from collections import defaultdict @command def doit(): ps, id, pnt = Ed.Editor.entSel("\nPick it: \n", Db.Solid3d.desc()) solid = Db.Solid3d(id) pe = Db.AssocPersSubentIdPE(solid.queryX(Db.AssocPersSubentIdPE.desc())) edge_map = defaultdict(list[Ge.Curve3d]) for vrt in pe.getAllSubentities(solid, Db.SubentType.kVertexSubentType): edge_map[pe.getVertexSubentityGeometry(solid, vrt)] for edge in pe.getAllSubentities(solid, Db.SubentType.kEdgeSubentType): crv = pe.getEdgeSubentityGeometry(solid, edge) edge_map[crv.getStartPoint()].append(crv) edge_map[crv.getEndPoint()].append(crv) for k, v in edge_map.items(): for _crv in v: Ed.Core.grDraw(_crv.getStartPoint(), _crv.getEndPoint(), 1, 0) return
  17. dexus

    Rotate ucs on 3d object

    If you press enter with n3 the Z axis seems to keep pointing in the same direction, so this like works for me: (if (and (setq n1 (getpoint)) (setq n2 (getpoint)) ) (command "_.ucs" "_3p" n1 n2 "") )
  18. Thanks! Code works fine, but I do prefer not to explode the solids. And the EVSD function has a problem with points snapping to the wrong position, adding "_none" to copy command might fix that. The link you posted mentioned the xedges command, which works quite well. Still prefer to do it without drawing or exploding anything, but this code works good enough for now: (defun solid->pts (ent / itm rtn) (setq itm (entlast)) (command "_xedges" ent) (while (> (getvar "cmdactive") 0) (command "") ) (while (setq itm (entnext itm)) (setq rtn (vl-list* (vlax-curve-getStartPoint itm) (vlax-curve-getEndPoint itm) rtn ) ) (if (entget itm) (entdel itm) ) ) (removeDuplicates (vl-remove nil rtn)) ) ; RemoveDuplicates - MP ; https://www.theswamp.org/index.php?topic=4144.msg49515#msg49515 (defun RemoveDuplicates (lst / index) (vl-remove-if 'RemoveDuplicatesSub lst) ) (defun RemoveDuplicatesSub (x) (cond ((vl-position x index)) ((null (setq index (cons x index)))) ) ) If anyone knows how to do it with the acis data, I would still love to hear it.
  19. TRY @dexus https://www.theswamp.org/index.php?topic=59838.0 try this ;------------------------------------------------------------------------------- ; EVS extract_vertices_from_solid ; EVSD extract_vertices_from_solid and dwaw point ; EVSE extract_vertices_from_solid and erase solid ; EVSED extract_vertices_from_solid and erase solid and draw points ;------------------------------------------------------------------------------ ; Written by Giovanni Anzani, ; University of florence ; Departement DIDA of architecture ;--------------------------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------------------------- (defun c:EVS () (extract_vertices_from_solid (car (entsel "\nSelect solid:")) nil nil)) (defun c:EVSD () (extract_vertices_from_solid (car (entsel "\nSelect solid:")) nil T)) (defun c:EVSE () (extract_vertices_from_solid (car (entsel "\nSelect solid:")) T nil)) (defun c:EVSED () (extract_vertices_from_solid (car (entsel "\nSelect solid:")) T T)) ;------------------------------------------------------------------------------------------------- (defun CMD-0 () (setq cm_old (getvar "cmdecho" )) (setvar "cmdecho" 0 )) (defun OSM-0 () (setq os_old (getvar "osmode" )) (setvar "osmode" 0 )) (defun BLI-0 () (setq bl_old (getvar "blipmode" )) (setvar "blipmode" 0 )) ;-------------------------------------------------------------------------------------------------- (defun CMD-P () (setvar "cmdecho" cm_old )) (defun OSM-P () (setvar "osmode" os_old )) (defun BLI-P () (setvar "blipmode" bl_old )) ;-------------------------------------------------------------------------------------------------- (defun VAR-0 () (CMD-0) (OSM-0) (BLI-0)) (defun VAR-P () (CMD-P) (OSM-P) (BLI-P) (command "_redraw") (princ)) ;-------------------------------------------------------------------------------------------------- (defun Draw_lPu (lPu / Pu) (VAR-0) (foreach Pu lPu (vl-cmdf "._point" Pu)) (VAR-P)) ;-------------------------------------------------------------------------------------------------- (defun remove_duplicates_from_list (l_raw / element l_clean) (while l_raw (setq element (car l_raw) l_clean (cons element l_clean) l_raw (vl-remove element l_raw))) (reverse l_clean)) ;-------------------------------------------------------------------------------------------------- (defun entnext_from_ent_to_end (ent0 / ent1 lent) (while (setq ent1 (entnext ent0)) (setq lent (cons ent1 lent) ent0 ent1) lent)) ;-------------------------------------------------------------------------------------------------- ; if you want, you can eliminate duplicates (defun extract_edges_from_solid (ent0 erase_solid / Pu0 ent1 lis_ent) (setq Pu0 '(0.0 0.0 0.0)) (command-s "._copy" ent0 "" Pu0 Pu0) (setq ent1 (entlast)) (command-s "._copy" ent1 "" Pu0 Pu0) (repeat 2 (foreach ent (entnext_from_ent_to_end ent1) (command-s "._explode" ent ""))) (setq lis_ent (entnext_from_ent_to_end ent1)) (if erase_solid (command-s "._erase" ent0 ent1 "") (command-s "._erase" ent1 "")) lis_ent) ;--------------------------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------------------------- (defun extract_vertices_from_solid (ent0 erase_solid draw_points / eent Pu1 Pu2 lis_Pu) (foreach ent (extract_edges_from_solid ent0 erase_solid) (if ent (progn (setq eent (vlax-ename->vla-object ent) Pu1 (vlax-curve-getStartPoint eent) eent_open (not (vlax-curve-isClosed eent)) Pu2 (if eent_open (vlax-curve-getEndPoint eent))) (command-s "._erase" ent ""))) (if Pu1 (setq lis_Pu (if (member Pu1 lis_Pu) lis_Pu (cons Pu1 lis_Pu)))) (if Pu2 (setq lis_Pu (if (member Pu2 lis_Pu) lis_Pu (cons Pu2 lis_Pu))))) (setq lis_Pu (remove_duplicates_from_list lis_Pu)) (if draw_points (Draw_lPu lis_Pu)) lis_Pu) ;----------------------------------------------------------------------------------------------- ; EOF ;-----
  20. Below is the output I get from the routine, but I cant find where the transform is made... ("21800" "93" "2" "12" "" "" "" "" "" "" "" "" "" "") ("16" "\001utodesk" "\001uto\003\001\004" "19" "\001\023\r" "220.0.0.5400" "\016\024" "0" "" "") ("25.399999999999999" "9.9999999999999995e-007" "1e-010" "") ("asmheader" "$-1" "-1" "12" "220.0.0.5400" "#") ("body" "$-1" "-1" "$-1" "$2" "$-1" "$3" "#") ("lump" "$-1" "-1" "$-1" "$-1" "$4" "$1" "#") ("#") ("shell" "$-1" "-1" "$-1" "$-1" "$-1" "$5" "$-1" "$2" "#") ("face" "$6" "-1" "$-1" "$7" "$8" "$4" "$-1" "$9" "forward" "single" "#") ("persubent-acad\023olid\010istory-attrib" "$-1" "-1" "$-1" "$-1" "$5" "1" "1" "2" "0" "#") ("face" "$10" "-1" "$-1" "$11" "$12" "$4" "$-1" "$13" "forward" "single" "#") ("loop" "$-1" "-1" "$-1" "$-1" "$14" "$5" "#") ("plane-surface" "$-1" "-1" "$-1" "0" "100" "0" "-1" "0" "0" "0" "-1" "0" "forward\037v" "I" "I" "I" "I" "#") ("persubent-acad\023olid\010istory-attrib" "$-1" "-1" "$-1" "$-1" "$7" "1" "1" "3" "0" "#") ("face" "$15" "-1" "$-1" "$16" "$17" "$4" "$-1" "$18" "forward" "single" "#") ("loop" "$-1" "-1" "$-1" "$-1" "$19" "$7" "#") ("plane-surface" "$-1" "-1" "$-1" "100" "100" "0" "0" "1" "-0" "-1" "0" "0" "forward\037v" "I" "I" "I" "I" "#") ("coedge" "$-1" "-1" "$-1" "$20" "$21" "$22" "$23" "forward" "$8" "0" "$-1" "#") ("persubent-acad\023olid\010istory-attrib" "$-1" "-1" "$-1" "$-1" "$11" "1" "1" "4" "0" "#") ("face" "$24" "-1" "$-1" "$25" "$26" "$4" "$-1" "$27" "forward" "single" "#") ("loop" "$-1" "-1" "$-1" "$-1" "$28" "$11" "#") ("plane-surface" "$-1" "-1" "$-1" "100" "0" "0" "1" "0" "0" "0" "1" "0" "forward\037v" "I" "I" "I" "I" "#") ("coedge" "$-1" "-1" "$-1" "$29" "$30" "$31" "$32" "forward" "$12" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$33" "$14" "$34" "$35" "forward" "$8" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$14" "$33" "$29" "$36" "reversed" "$8" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$31" "$37" "$14" "$23" "reversed" "$38" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$39" "0" "$40" "100" "$14" "$41" "forward" "7" "unknown" "#") ("persubent-acad\023olid\010istory-attrib" "$-1" "-1" "$-1" "$-1" "$16" "1" "1" "1" "0" "#") ("face" "$42" "-1" "$-1" "$43" "$44" "$4" "$-1" "$45" "forward" "single" "#") ("loop" "$-1" "-1" "$-1" "$-1" "$46" "$16" "#") ("plane-surface" "$-1" "-1" "$-1" "0" "0" "0" "0" "-1" "0" "1" "0" "0" "forward\037v" "I" "I" "I" "I" "#") ("coedge" "$-1" "-1" "$-1" "$47" "$48" "$49" "$50" "forward" "$17" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$51" "$19" "$21" "$36" "forward" "$12" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$19" "$51" "$47" "$52" "reversed" "$12" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$49" "$22" "$19" "$32" "reversed" "$38" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$53" "0" "$39" "100" "$19" "$54" "forward" "7" "unknown" "#") ("coedge" "$-1" "-1" "$-1" "$21" "$20" "$55" "$56" "reversed" "$8" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$46" "$57" "$20" "$35" "reversed" "$26" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$40" "0" "$58" "100" "$34" "$59" "forward" "7" "unknown" "#") ("edge" "$-1" "-1" "$-1" "$39" "0" "$60" "100" "$29" "$61" "forward" "7" "unknown" "#") ("coedge" "$-1" "-1" "$-1" "$22" "$49" "$46" "$62" "reversed" "$38" "0" "$-1" "#") ("loop" "$-1" "-1" "$-1" "$-1" "$37" "$43" "#") ("vertex" "$-1" "-1" "$-1" "$32" "1" "$63" "#") ("vertex" "$-1" "-1" "$-1" "$62" "0" "$64" "#") ("straight-curve" "$-1" "-1" "$-1" "0" "100" "0" "0" "-1" "0" "\006" "0" "\006" "100" "#") ("persubent-acad\023olid\010istory-attrib" "$-1" "-1" "$-1" "$-1" "$25" "1" "1" "1000000000" "2" "#") ("face" "$65" "-1" "$-1" "$-1" "$38" "$4" "$-1" "$66" "reversed" "single" "#") ("loop" "$-1" "-1" "$-1" "$-1" "$67" "$25" "#") ("plane-surface" "$-1" "-1" "$-1" "50" "50" "100" "0" "0" "1" "1" "0" "0" "forward\037v" "I" "I" "I" "I" "#") ("coedge" "$-1" "-1" "$-1" "$68" "$34" "$37" "$62" "forward" "$26" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$69" "$28" "$30" "$52" "forward" "$17" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$28" "$69" "$68" "$70" "reversed" "$17" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$37" "$31" "$28" "$50" "reversed" "$38" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$71" "0" "$53" "100" "$28" "$72" "forward" "7" "unknown" "#") ("coedge" "$-1" "-1" "$-1" "$30" "$29" "$73" "$74" "reversed" "$12" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$53" "0" "$75" "100" "$47" "$76" "forward" "7" "unknown" "#") ("vertex" "$-1" "-1" "$-1" "$50" "1" "$77" "#") ("straight-curve" "$-1" "-1" "$-1" "100" "100" "0" "-1" "0" "0" "\006" "0" "\006" "100" "#") ("coedge" "$-1" "-1" "$-1" "$67" "$73" "$33" "$56" "forward" "$44" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$60" "0" "$58" "100" "$33" "$78" "forward" "7" "unknown" "#") ("coedge" "$-1" "-1" "$-1" "$34" "$68" "$67" "$79" "reversed" "$26" "0" "$-1" "#") ("vertex" "$-1" "-1" "$-1" "$35" "1" "$80" "#") ("straight-curve" "$-1" "-1" "$-1" "0" "0" "0" "0" "0" "1" "I" "I" "#") ("vertex" "$-1" "-1" "$-1" "$36" "1" "$81" "#") ("straight-curve" "$-1" "-1" "$-1" "0" "100" "0" "0" "0" "1" "I" "I" "#") ("edge" "$-1" "-1" "$-1" "$40" "0" "$71" "100" "$46" "$82" "forward" "7" "unknown" "#") ("point" "$-1" "-1" "$-1" "0" "100" "0" "#") ("point" "$-1" "-1" "$-1" "0" "0" "0" "#") ("persubent-acad\023olid\010istory-attrib" "$-1" "-1" "$-1" "$-1" "$43" "1" "1" "1000000000" "1" "#") ("plane-surface" "$-1" "-1" "$-1" "50" "50" "0" "0" "0" "1" "1" "0" "0" "forward\037v" "I" "I" "I" "I" "#") ("coedge" "$-1" "-1" "$-1" "$83" "$55" "$57" "$79" "forward" "$44" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$57" "$46" "$48" "$70" "forward" "$26" "0" "$-1" "#") ("coedge" "$-1" "-1" "$-1" "$48" "$47" "$83" "$84" "reversed" "$17" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$71" "0" "$85" "100" "$68" "$86" "forward" "7" "unknown" "#") ("vertex" "$-1" "-1" "$-1" "$62" "1" "$87" "#") ("straight-curve" "$-1" "-1" "$-1" "100" "0" "0" "0" "1" "0" "\006" "0" "\006" "100" "#") ("coedge" "$-1" "-1" "$-1" "$55" "$83" "$51" "$74" "forward" "$44" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$75" "0" "$60" "100" "$51" "$88" "forward" "7" "unknown" "#") ("vertex" "$-1" "-1" "$-1" "$52" "1" "$89" "#") ("straight-curve" "$-1" "-1" "$-1" "100" "100" "0" "0" "0" "1" "I" "I" "#") ("point" "$-1" "-1" "$-1" "100" "100" "0" "#") ("straight-curve" "$-1" "-1" "$-1" "0" "100" "100" "0" "-1" "0" "I" "I" "#") ("edge" "$-1" "-1" "$-1" "$58" "0" "$85" "100" "$57" "$90" "forward" "7" "unknown" "#") ("point" "$-1" "-1" "$-1" "0" "0" "100" "#") ("point" "$-1" "-1" "$-1" "0" "100" "100" "#") ("straight-curve" "$-1" "-1" "$-1" "0" "0" "0" "1" "0" "0" "\006" "0" "\006" "100" "#") ("coedge" "$-1" "-1" "$-1" "$73" "$67" "$69" "$84" "forward" "$44" "0" "$-1" "#") ("edge" "$-1" "-1" "$-1" "$85" "0" "$75" "100" "$69" "$91" "forward" "7" "unknown" "#") ("vertex" "$-1" "-1" "$-1" "$70" "1" "$92" "#") ("straight-curve" "$-1" "-1" "$-1" "100" "0" "0" "0" "0" "1" "I" "I" "#") ("point" "$-1" "-1" "$-1" "100" "0" "0" "#") ("straight-curve" "$-1" "-1" "$-1" "100" "100" "100" "-1" "0" "0" "I" "I" "#") ("point" "$-1" "-1" "$-1" "100" "100" "100" "#") ("straight-curve" "$-1" "-1" "$-1" "0" "0" "100" "1" "0" "0" "I" "I" "#") ("straight-curve" "$-1" "-1" "$-1" "100" "0" "100" "0" "1" "0" "I" "I" "#") ("point" "$-1" "-1" "$-1" "100" "0" "100" "#")
  21. Hello everyone, I want to do the following briefly. I'll specify two points, and it will automatically find the third point, then rotate it on the Z axis. This should work in both UCS and WCS. ... (setq n1 (getpoint)) (setq n2 (getpoint)) (command "_.ucs" "_3p" n1 n2 n3) (command "_.ucs" "ZA" n1 n2) ...
  22. Yesterday
  23. Some more. Note the Lst is sorted as in the spagetti code, sort on description 1st then point number. ; groupby provided by Dexus (defun _groupBy (fun lst0 / itm old rtn) (while lst0 (setq itm (fun (car lst0)) rtn (if (setq old (assoc itm rtn)) (subst (cons itm (cons (car lst0) (cdr old))) old rtn) (cons (cons itm (list (car lst0))) rtn) ) lst0 (cdr lst0)) ) rtn ) (setq lst2 (_groupBy (lambda (e) (car e)) lst))
  24. Just a out there way to get centroid, if you have a open pline then close it, use "Extrude" a height of say 10, then use "Massprop". Centroid: X= 0.388 Y= -3.101 Z= 5 Ok so choose the write to file option and read the centroid from the file, the sixth line. If you want the pline open then do a UNDO. Yes it will be a lisp, have used the write to file for concrete Tilt panels to mark the centroid.
  25. leonucadomi

    SELECT TEXTS OTHER THAN 3.5..HELP

    thanks master
  26. Steven P

    SELECT TEXTS OTHER THAN 3.5..HELP

    Ahh, that's my mistake, try this: (defun c:test (/ old_err EscVP StrScale2 TxtHt StrScale ss) (setq old_err *error*) (defun *error* ( a / ) ;; Add here return cmdecho to as it was, cmdecho 1 (princ "") (setq *error* old_err) (princ) ) ; End Error Defun (setvar "cmdecho" 0) ; perhaps record the state of cmdecho before here, and reset to that value at the end (if (and (setq EntVP (car (entsel "\Seleccione VIEWPORT: "))) (= (cdr (assoc 0 (entget EntVP))) "VIEWPORT") ) ; end and (progn (setq EscVP (vla-get-CustomScale (vlax-ename->vla-object EntVP))) (setq StrScale2 (rtos (* 3.5 (/ 1 EscVP)) 2 1)) (setq TxtHt (* 3.5 (/ 1 EscVP)) ) ; a number not a string ;; added this (setq StrScale (rtos (/ 1 EscVP) 2 2)) (setq vpnum (cdr (assoc 69 (entget EntVP )))) (vl-cmdf "_.mspace") (setvar "CVPORT" vpnum) (setq ss (ssget (list '(0 . "TEXT") '(-4 . "<>") (cons 40 TxtHt))) ) ;; corrected line ;;What are you doing with ss now? (Prompt (strcat "\nLa escala de La Ventana es 1/" StrScale)) (princ "\nLos textos de 3.5 en el interior de la ventana deben ser de: ") (princ StrScale2) ) ; end progn ) ; end if (setvar "cmdecho" 1) (princ) );fin defun
  27. Maybe something in my post or the one of Lee Mac's I linked...
  1. Load more activity
×
×
  • Create New...