Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/15/2024 in all areas

  1. With lisp, you can try this: (defun bulge_pts (pt_cen pt_begin pt_end rad sens / inc ang nm p1 p2 lst) (setq inc (angle pt_cen (if (< sens 0.0) pt_end pt_begin)) ang (+ (* 2.0 pi) (angle pt_cen (if (< sens 0.0) pt_begin pt_end))) nm (fix (/ (rem (- ang inc) (* 2.0 pi)) (/ (* pi 2.0) 36.0))) ) (repeat nm (setq p1 (polar pt_cen inc rad) inc (+ inc (/ (* pi 2.0) 36.0)) lst (append lst (list p1)) ) ) (setq p2 (polar pt_cen ang rad) lst (append lst (list p2)) ) (if (< sens 0.0) (reverse lst) lst) ) (defun c:arc2pl3D ( / ss AcDoc Space flag n ent dxf_ent name_layer lst) (princ "\nSelect arcs: ") (setq ss (ssget '((0 . "ARC")))) (cond (ss (setq AcDoc (vla-get-ActiveDocument (vlax-get-acad-object)) Space (if (= 1 (getvar "CVPORT")) (vla-get-PaperSpace AcDoc) (vla-get-ModelSpace AcDoc) ) ) (vla-startundomark AcDoc) (initget "Yes No") (if (eq (getkword "\nErase source arc [Yes/No]? <No>: ") "Yes") (setq flag T) (setq flag nil) ) (repeat (setq n (sslength ss)) (setq dxf_ent (entget (setq ent (ssname ss (setq n (1- n))))) name_layer (cdr (assoc 8 dxf_ent)) lst (bulge_pts (cdr (assoc 10 dxf_ent)) (polar (cdr (assoc 10 dxf_ent)) (cdr (assoc 50 dxf_ent)) (cdr (assoc 40 dxf_ent))) (polar (cdr (assoc 10 dxf_ent)) (cdr (assoc 51 dxf_ent)) (cdr (assoc 40 dxf_ent))) (cdr (assoc 40 dxf_ent)) 1 ) ) (cond (lst (vla-put-Layer (vlax-invoke Space 'Add3dPoly (apply 'append (mapcar '(lambda (x) (trans x (cdr (assoc 210 dxf_ent)) 0)) lst ) ) ) name_layer ) (if flag (entdel ent)) ) ) ) (vla-endundomark AcDoc) ) (T (princ "\nEmpty selection")) ) (prin1) )
    2 points
  2. something like this (defun c:doit ( / doc ep i modelspace mp obj p points polyobj prms sapoints sp util) (vl-load-com) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq util (vla-get-utility doc)) (vla-getentity util 'obj 'ip "\nSelect Object: ") (setq prms '()) (setq sp (vlax-curve-getStartParam obj)) (setq ep (vlax-curve-getEndParam obj)) (setq mp (/ (- ep sp ) 31)) (setq i mp) (setq prms (append prms (list sp))) (repeat 30 (setq sp (+ i sp)) (setq prms (append prms (list sp))) ) (setq prms (append prms (list ep))) (setq points '()) (foreach p prms (setq points (append points (vlax-curve-getPointAtParam obj p))) ) (setq sapoints (vlax-make-safearray vlax-vbDouble (cons 0 (-(length points)1)))) (vlax-safearray-fill sapoints points) (setq modelSpace (vla-get-ModelSpace doc)) (setq polyObj (vla-Add3DPoly modelSpace sapoints)) )
    1 point
  3. Hello friends, Running a forum like this often feels like a long-running battle against those who would like to deface or destroy what we do here. From time-to-time we need to change the way we operate to stay one step ahead of the hackers and haters. From today, the way you login to this forum will change. Historically, you've been able to login using your screen name and password. The problem with this approach is that your screen name is publicly available, so all a hacker has to do is to find your password. From today, you will not be able to login using your screen name, you will need to use the email address associated with your account. Since your email address is not publicly available, this change presents a significant defense against hackers. If you already login using your email address, you do not need to change the way you login. We recommend that you always use a strong password to avoid your account being hacked.
    1 point
×
×
  • Create New...