Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/13/2019 in all areas

  1. If you use vl, : (setq obj (vlax-ename->vla-object (car (entsel "pick object")))) pick object#<VLA-OBJECT IAcadMLine 000000005841DB50> : (setq co-ords (vlax-get Obj 'coordinates)) (104.0 88.0 0.0 440.0 180.0 0.0 520.0 98.0 0.0) (setq name (vla-get-StyleName obj)) "STANDARD" I did something with mlines need to find again the other variable is the offsets from the main line/s then say you can get the 4 corner points. I think its in the mlinestyle for offsets. Found a good example how to put it into practice https://www.afralisp.net/autolisp/tutorials/dictionaries-and-xrecords.php (setq objdict (namedobjdict)) (setq mldict (dictsearch objdict "ACAD_MLINESTYLE")) (setq mlineStd (dictsearch (cdr (assoc -1 mlDict)) "Standard")) ; replace mline style name (setq offs (mapcar 'cdr (vl-remove-if-not '(lambda (x) (= (car x) 49)) mlinestd))) This is a two segment mline with + - offsets 3 lines. The offs is a list of the offset values of the mline. (-20.0 0.0 20.0) Unfortunately you need to work out the offset line points if say you want to do a cap, the cap is a Mline style option, so you could create a new mline. with caps then erase old one. I don't believe you can change the style maybe .net ?
    1 point
  2. i have excel vba file for draw x-section of canal in auto cad but i don,t know how to attach file here in this forum. if any body intrested for this please contact me. Regards:- Shahid Chaudhry shahidchaudhry55@yahoo.com shahidjutt55@hotmail.com
    1 point
  3. A very quick modification to your code to get it working for you: (defun zk:Offset ( obj dist par_wz / vlaObj1 vlaObj2 dlg_1 dlg_2 ) (if (cond ( (equal (vla-get-objectname obj) "AcDbPolyline") (setq vlaObj1 (car (vlax-invoke obj 'Offset dist)) vlaObj2 (car (vlax-invoke obj 'Offset (- dist))) dlg_1 (vla-get-length vlaObj1) dlg_2 (vla-get-length vlaObj2) ) ) ( (equal (vla-get-objectname obj) "AcDbCircle") (setq vlaObj1 (car (vlax-invoke obj 'Offset dist)) vlaObj2 (car (vlax-invoke obj 'Offset (- dist))) dlg_1 (vla-get-circumference vlaObj1) dlg_2 (vla-get-circumference vlaObj2) ) ) ) (if (= par_wz 1) (if (< dlg_1 dlg_2) (vla-delete vlaObj1) (vla-delete vlaObj2) ) (if (> dlg_1 dlg_2) (vla-delete vlaObj2) (vla-delete vlaObj1) ) ) ) (princ) ) (defun c:test ( / e ) (if (setq e (car (entsel))) (zk:Offset (vlax-ename->vla-object e) 50.0 1) ) ) Note that vlax-erased-p tests whether an object is erased, and does not erase the object.
    1 point
×
×
  • Create New...