Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/09/2022 in all areas

  1. @leonucadomi Give this a try: (defun c:foo (/ a b e h hp p x) ;; RJP » 2022-09-08 (cond ((and (setq e (car (entsel "\nPick source hatch: "))) (= "HATCH" (cdr (assoc 0 (entget e)))) (setq b (assoc 2 (entget e))) (setq e (vlax-ename->vla-object e)) (setq a (mapcar '(lambda (x) (list x (vlax-get e x))) '(associativehatch backgroundcolor elevation entitytransparency gradientangle gradientcentered gradientcolor1 gradientcolor2 gradientname hatchobjecttype hatchstyle isopenwidth layer linetype linetypescale lineweight material origin patternangle patterndouble patternscale patternspace plotstylename truecolor visible ) ) ) ) (setq hp (getvar 'hpname)) (setvar 'hpname (cdr b)) (while (setq p (getpoint)) (setq h (entlast)) (command "_.bhatch" p "") (cond ((not (equal h (setq h (entlast)))) (setq h (vlax-ename->vla-object h)) (foreach x a (vl-catch-all-apply 'vlax-put (list h (car x) (cadr x)))) ;; patternname (RO) cannot be set via vla for some reason ? ;; (setq h (entget (vlax-vla-object->ename h))) ;; (entmod (subst b (assoc 2 h) h)) ) ) ) (setvar 'hpname hp) ) ) (princ) )
    4 points
  2. Try this. So, the general way of doing it: - For every object I look if properties have been set, or if the property is ByLayer. I did this for Color, Line Width, Line Type. (If something is missing, tell me) - If the property is ByLayer, then I look at the layer, and what properties the layer has. Then I copy those layer properties to the object properties. - Last action is to set the layer to "0" See if it works, else let me know (Feel free to rename the command. I named it GLP for Get Layer Properties or something) ;; given a layer name, return a list of the properties of that layer. (defun layer_get_properties (Lay / ) laydata (entget (tblobjname "Layer" Lay)) ) (defun c:glp ( / ss i obj Lay ent layer_props col_obj col_lay wid_obj wid_lay typ_obj typ_lay) ;; user selects objects (setq ss (ssget)) (setq i 0) (repeat (sslength ss) ;; do for all select objects: (setq obj (ssname ss i)) (setq ent (entget obj)) ;; layer of the object (setq Lay (cdr (assoc 8 ent))) ;; layer properties (setq layer_props (layer_get_properties Lay)) ;; COLOR - property 62 ;; color of the object / color of the layer (setq col_obj (cdr (assoc 62 ent))) (setq col_lay (cdr (assoc 62 layer_props))) ;; Now we'll see if the object has set the color, or if the color is ByLayer. ;; If the color is ByLayer, then we should copy the color of the layer and set it to the object. (if (= nil col_obj) ;; object layer is set to ByLayer. (entmod (append ent (list (cons 62 col_lay) ) )) ) ;; Line width - property 370 (setq wid_obj (cdr (assoc 370 ent))) (setq wid_lay (cdr (assoc 370 layer_props))) (if (= nil wid_obj) (entmod (append ent (list (cons 370 wid_lay) ) )) ) ;; Line type - property 6 (setq typ_obj (cdr (assoc 6 ent))) (setq typ_lay (cdr (assoc 6 layer_props))) (if (= nil typ_obj) (entmod (append ent (list (cons 6 typ_lay) ) )) ) ;; set layer to "0" (entmod (subst (cons 8 "0") (assoc 8 ent) ent)) (setq i (+ i 1)) ) (princ) )
    2 points
  3. Give this a try: (defun c:foo (/ s) ;; RJP » 2022-09-09 ;; Generate vertical xlines on polyline vertexes (if (setq s (ssget '((0 . "LWPOLYLINE")))) (progn (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (foreach p (vl-remove-if '(lambda (x) (/= 10 (car x))) (entget e)) (entmakex (list '(0 . "XLINE") '(100 . "AcDbEntity") '(67 . 0) '(8 . "XLINE") '(100 . "AcDbXline") p '(11 0.0 1.0 0.0) ) ) ) ) ;; Make layer not plot and color 128,128,128 (entmod (append (entget (tblobjname "LAYER" "XLINE")) '((290 . 0) (420 . 8421504)))) ) ) (princ) )
    1 point
  4. My code above matches colors as well as gradients
    1 point
  5. US Civil drawings are done in feet, I've never seen coordinates in inches except in architectural drawings.
    1 point
  6. I would suggest that you open the thread entitled "Penn Foster Student Suffering with Oleson Village Map" and specifically go to page 21, the last page, and read the 10th, 11th, 12th and 14th posts. That should get you started. The thread can be found in the AutoCAD > AutoCAD Beginners' Area > Student Project Questions. The same thread, if you start at the beginning, has further information that may prove useful to you as you tackle this project. Re: Decimal units. "Decimal units are unitless — that is, they’re not based on any particular real-world unit. With decimal units, each unit in the drawing could represent an inch, a millimeter, a parsec, a furlong, a fathom, a cubit (if you’re into building arks in case that rainy day should come), or any other unit of measure you deem suitable, from Danish alens to the Swiss zoll. An example would be 15.5." Source: "AutoCAD for Dummies" In the case of the Oleson Village Project the units would represent feet.
    1 point
  7. Have you tried the FILLET command with radius 0 (zero)?
    1 point
  8. upload a sample drawing what your looking for
    1 point
  9. Hi all, is my first post here: I'am CADaSchtroumpf on forum AutoDesk. My try For a speed of execution it is asked to select only the polylines likely to be concerned by the iso-distance search Then the base/reference point of the measurement. This base point can be anywhere, if it is not at the origin or at the end of the polyline, it will be cut (but preserving the Map object data and/or the Xdata) You will also be asked for a fuzz for equality: network in large coordinates or standard. If a secondary polyline is not attached to a vertex of the primary polyline, a vertex will be inserted at this node. Tree research is done at all levels. In the end points are created at the iso-distance of the base point. iso_distance.fas
    1 point
×
×
  • Create New...