Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/18/2023 in all areas

  1. try this sachindkini.lsp
    1 point
  2. Hi all, My work have recently "upgraded" to Autocad LT 23 from an older full Autocad & as a result, I can no longer run my time saving Lisp routines. We use a third party program which exports several dwg files per job. I had been using lisp to insert each dwg file as a block in my drawing, all spaced out along a row (eg block chart or insertblks). Is there a way to do this without lisp? Everything i've found would mean importing one at a time. Thanks
    1 point
  3. It appears AutoCAD LT 2024 can use LISP. Hopefully you can upgrade now.
    1 point
  4. Had a quick look and Acad_proxy_entity is the rectang and the holes, how was that made ? Was it from a "part" in other software ? For me can make rectang Draw holes as required Do all dims All objects plain CAD objects, pline. donut, dims. Let me know if happy with this idea. Objects on correct layer etc. Would have a dcl for enter data. Are the holes different offsets / dia on left v's right.
    1 point
  5. In a viewport there is a variable that holds the centre point so can match with Model and nominate a scale as well. This is cut from a bigger program but should give you some ideas. The code makes rectangs the size of the mview in plan at scale matching title block. Then makes multiple layouts. ; mp is your point in model space ; ahsc is the scale value for metric it would be say 1:100 = 1000/100 =10 ; for imperial like 12 48 96 based on 1 foot (setq ent (ssname (ssget "x" (list (cons 0 "Viewport")(cons 410 (getvar 'ctab)))) 0)) (setq obj (vlax-ename->vla-object ent)) (command "mspace") (command "zoom" "C" mp 500) (command "zoom" "C" mp (strcat (rtos ahsc 2 1) "XP") ) (command "pspace") (vla-put-DisplayLocked obj -1)
    1 point
  6. @motee-z The 3 Z levels: Command: HV Select a solid : ((735.489 -232.24 0.0) (785.516 -182.239 0.0)) Command: Command: HV Select a solid : ((735.489 -232.24 10.0) (785.516 -182.239 10.0)) Command: Command: HV Select a solid : ((735.489 -232.24 20.0) (785.516 -182.239 20.0)) And Select objects: ---------------- SOLIDS ---------------- Mass: 39275.8502 Volume: 39275.8502 Bounding box: X: 795.7368 -- 845.7632 Y: -238.1375 -- -188.1366 Z: 0.0000 -- 20.0000 Centroid: X: 820.7639 Y: -213.1356 Z: 10.0000 Moments of inertia: X: 1795547360.0643 Y: 26469683241.1093 Z: 28254757040.9697 Products of inertia: XY: 6870683129.3554 YZ: 83710801.8756 ZX: -322361988.9260 Radii of gyration: X: 213.8138 Y: 820.9403 Z: 848.1702 And the solid 'HV' code: Command: HV Select a solid : ((795.737 -238.138 0.0) (845.763 -188.137 20.0)) VLA-GET-VOLUME (level 20) 39275.850 ;; Your result 39276041.21
    1 point
  7. I merged your posts. Please do not create new posts for the same topic.
    1 point
  8. 1 point
  9. I use it when I come across lisp i like online that use a separate dcl file and want to make them into one file. like this. https://cadtips.cadalyst.com/edit-blocks/nested-block-tree-display
    1 point
  10. @mhupp : one of many routines I wrote for fun or just because I was bored (and then only used it once or twice) haha... glad it's still useful. But I wished Autodesk added a dialog editor similar to the VBA form editor. But no problem because in most cases I use last app I made , delete everything except ok-cancel and type in the rest on the fly in new routine (after I made a drawing with design) because like most processes start with a good (block) diagram : how do I want it to look and / or work and then start coding, not the other way around. (defun TC1 ( / dcl-fn dcl-fp dcl-id s drv) (if (setq dcl-fp (open (setq dcl-fn (strcat (getvar "TEMPPREFIX") "TMP_H.DCL")) "w")) (foreach s '("hhimg : dialog {label=\"parametric fill : Email : Sachin\";" "spacer_1;" ":boxed_radio_column {label=\"fill style\";" ":radio_button{label=\"I-shaped paving\"; key=\"EH1\";}" ":radio_button{label=\"Herringbone paving\"; key=\"EH2\";}" ":radio_button{label=\"Chamfered rectangle\"; key=\"EH3\";}" ":radio_button{label=\"braided texture\"; key=\"EH4\";}" ":radio_button{label=\"binary rectangle\"; key=\"EH5\";}" "}" ":image_button {key=\"HHIMG\";color=-2;width=30;aspect_ratio=1;allow_accept=true;}" "spacer_1;" ":row {:edit_box {label=\"Parameter A\";key=\"CSA\";}" ":edit_box {label=\"Parameter B\";key=\"CSB\";}}" "spacer_1;" ":row {:button {label=\"Select a closed polyline\";key=\"YYL\";width=10;fixed_width=true;}" ":button {label=\"Pick fill interior points\";key=\"YYT\";width=10;fixed_width=true;}}" "ok_cancel;" "}" ) (write-line s dcl-fp) ) ) (if dcl-fp (progn (close dcl-fp)(gc))) (if (and (setq dcl-id (load_dialog dcl-fn)) (new_dialog "hhimg" dcl-id)) (progn (action_tile "cancel" "(done_dialog 0)") (action_tile "accept" "(done_dialog 1)") (setq drv (start_dialog)) (if dcl-fn (vl-file-delete dcl-fn)) (cond ((= drv 0)(princ "\nCancelled")) ((= drv 1)(princ "\nok")) ) ) ) (princ) ) (TC1)
    1 point
  11. @rlx made this useful lisp to convert stand alone dcl files into lisp. so things have the proper " " and slashes. -Edit
    1 point
  12. This is what I use in line 1 of a dialog: '( "pass : dialog { key = \"DialogueKey\"; label = \"Dialogue Label\"; " Note I don't have any \\n in mine Finishing I use: (write-line STREAM des) ) ;;end foreach (setq DCL_T (LOAD_DIALOG (STRCAT (GETVAR "TEMPPREFIX") "TMP_H.DCL"))) (NEW_DIALOG "hhimg" DCL_T) Noting that I use (write-line to create the temporary file, you are using princ Try that and see Copy and pasted from other stuff and not checked if I have copied everything (weekend... CAD is off here....)
    1 point
×
×
  • Create New...