Jump to content

Leaderboard

Popular Content

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

  1. Best you can do is plot as an image file then skew and insert the image file into a drawing. Plenty of threads and various methods on here, but nothing is 100%. Even easier to replicate if enough vital dimensions are given.
    2 points
  2. Yeah, that's true. Thanks for your help. It doesn't bother me that much either. I think in your example the ssget would be better with to avoid the selection of solid hatches and gradients. (setq ss (ssget "_:L" '((0 . "HATCH") (2 . "~SOLID") (-4 . "<NOT") (2 . "*`,*") (-4 . "NOT>"))))
    1 point
  3. Yeah - I looked into that. It is certainly possible, but you would have to manually code much of the functionality of the HATCHEDIT command, such as all the "Bottom Left, Top Left, etc...". More than I have time to play with in code. Using HATCHEDIT works just fine for it
    1 point
  4. @pkenewell Yes you are absolutely right, I was just curious about the internals of acet-ss-drag-move. It eliminates most of the hassle as you have stated. Thank you!
    1 point
  5. @3dwannab A couple more notes: 1) setting "NOMUTT" is unnecessary and removes your program prompts from the command line, while it has no effect on the HATCHEDIT command. Makes it confusing. 2) Your loop structure forces a hard exit from the "Pickone" option, better to change to a different loop to avoid this. 3) you should check for missed picks in the (entsel) using errno system variable. FWIW, this is how I would write the code. (defun c:HH_Origin_Location (/ acdoc ans ent *error* oecho oosnh pt px py pnew ss) ; Local error function (defun *error* (errmsg) (and acDoc (vla-EndUndoMark acDoc)) (and errmsg (not (wcmatch (strcase errmsg) "*CANCEL*,*EXIT*")) (princ (strcat "\n<< Error: " errmsg " >>\n")) ) (setvar 'cmdecho oecho) (setvar 'osnaphatch oosnh) (princ) ) (setq acDoc (vla-get-ActiveDocument (vlax-get-acad-object)) oecho (getvar 'cmdecho) oosnh (getvar 'osnaphatch) ) (or (vla-EndUndoMark acDoc) (vla-StartUndoMark acDoc)) (setvar 'cmdecho 0) (setvar 'osnaphatch 1) (initget "bottomLeft bottomRight toprIght toplEft Center Pickone pickAll Offset") (if (not (setq ans (getkword "\nChoose hatch location: [bottom Left/bottom Right/top rIght/top lEft/Center/Pick one/pick All/Offset] <Pick one>: "))) (setq ans "Pickone") ) (if (= ans "Pickone") (while (progn (setvar "errno" 0) (setq ent (entsel "\n\nSelect Hatch <Exit>: ")) (cond ((= 7 (getvar "errno"))(princ "\nNo Object Selected. Try Again...\n")) ((vl-consp ent) (if (/= (cdr (assoc 0 (entget (car ent)))) "HATCH") (princ "\nInvalid Object Selected. Please Select a HATCH Object. ") (progn (if (setq pt (getpoint "\nNew hatch origin: ")) (progn (command "_.HatchEdit" (car ent) "_O" "_S" "_non" pt "_Y") (setq ss (if ss (ssadd (car ent) ss) (ssadd (car ent)))) ) (princ "\nNo Point Selected. Please restart Selection. ") ) T ) ) ) ) ) ) (progn (cond ((= ans "pickAll")(setq pt (getpoint "\nNew hatch origin: "))) ((= ans "Offset")(setq pt (getpoint "\nOffset by (x,y): "))) ) (if (and (or (not (wcmatch ans "pickAll,Offset")) pt) (progn (princ "\nSelect Hatch Objects: ")(setq ss (ssget "_:L" '((0 . "HATCH"))))) ) (repeat (setq i (sslength ss)) (setq ent (ssname ss (setq i (1- i)))) (cond ((= ans "bottomLeft")(command-s "_.HatchEdit" ent "_O" "_D" "_L" "_Y")) ((= ans "bottomRight")(command-s "_.HatchEdit" ent "_O" "_D" "_R" "_Y")) ((= ans "toprIght")(command-s "_.HatchEdit" ent "_O" "_D" "_I" "_Y")) ((= ans "toplEft")(command-s "_.HatchEdit" ent "_O" "_D" "_E" "_Y")) ((= ans "Center")(command-s "_.HatchEdit" ent "_O" "_D" "_C" "_Y")) ((= ans "pickAll")(command-s "_.HatchEdit" ent "_O" "_S" "_non" pt "_Y")) ((= ans "Offset") (setq el (entget ent) pX (cdr (assoc 43 el)) pY (cdr (assoc 44 el)) pNEW (mapcar '+ pt (list pX pY 0)) ) (command-s "_.HatchEdit" ent "_O" "_S" "_non" pNEW "_Y") ) ) ) ) ) ) (if ss (princ (strcat "\n " (itoa (sslength ss)) (if (> (sslength ss) 1) " hatches" " hatch") " changed using " ans " option. "))) (*error* nil) (princ) )
    1 point
  6. "I can't find much online which provides info about tables" This has been asked so many times and the answer is in the way you Google you need to do like this, "Make table from blocks Autocad lisp" About 187,000 results Ok second answer is "Add block image to Table autocad lisp" 3rd answer is make a table with more columns add the text. Ok now the problem, you need a big look up list as hinted you can have some signs in more than 1 size. Hidden attributes would help you can save the size and type, just set attributes to invisible, but they are there for block counting. A sort of blocks using a list of (name size type.... and so can count the same sign but different sizes. One way around the getting table correct is to do just that and make a custom table in your code checking does it exist. That way all settings are correct. Before everybody jumps in really need you to supply a couple of real block examples, it is very frustrating to have like 5 goes at code because true block names are not there. Really need attributes also or else how know size ? The block names seem odd any reason for that rather than like "STOP" "Warning1" yes I have access to hundreds of signs in some other software.
    1 point
  7. Here is an simple alternate method using an "acet" Express Tools function from the arx. Note: Express Tools must be installed. (defun C:CBP (/ bp en p2 ss) (if (not (acet-util-ver)) (arxload "acetutil.arx" (progn (princ "\nExpress Tools Failed to Load. Program Aborted.") (exit) ) ) ) (if (and (progn (princ "\nSelect Objects to Copy: ")(setq ss (ssget))) (setq bp (getpoint "\nSelect Base Point of Displacement: ")) ) (progn (command "copybase" bp ss "") (while (setq p2 (acet-ss-drag-move ss bp "\nSelect Second Point of Displacement: " T)) (command "pasteclip" p2) ) ) ) (princ) )
    1 point
  8. This seems to work fine for me. However, I had to change the hatch pattern because I do not have the same pattern as yours. Perhaps you need to post the *.pat file associated with the hatch you are using as well. Another general thing I noticed is that the object snaps, might be interfering with the Hatch edit command. use the "_non" osnap to disable the osnaps when placing the point in the command. Try changing the following lines (#s 76, 119 and 150 respectively): (command-s "_.HatchEdit" ent "_O" "_S" pt "_Y") TO (command-s "_.HatchEdit" ent "_O" "_S" "_non" pt "_Y") AND (command-s "_.HatchEdit" ent "_O" "_S" ptHatchOriginXYNew "_Y") TO (command-s "_.HatchEdit" ent "_O" "_S" "_non" ptHatchOriginXYNew "_Y") Also add the same in front of placing your test points for accurate locating: (command "point" "_non" (list ptHatchOriginX ptHatchOriginY 0)) (command "point" "_non" ptHatchOriginXYNew)
    1 point
  9. There is lengthen lisps or even "Lengthen" command so draw a line then enter length. Just a back to basics with ortho on, start drawing a line and drag to direction with mouse, type length and that is what it will be, no code required. Works with mline also. I would do a part 2 label "ALL" beams.
    1 point
×
×
  • Create New...