Jump to content

Leaderboard

Popular Content

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

  1. It's always a good idea to write your dcl file into the lisp, then there is only one file to keep track of. here is a post I stumbled across a few months ago. https://www.cadtutor.net/forum/topic/66737-convert-dcl-file-to-lisp-file/
    2 points
  2. Try it with vlax-invoke or convert the coordinates to variant as the error message indicates to. (vla-move newtxt (vlax-3d-point BP) (vlax-3d-point pt)) ;; replaced with (vla-move newtxt BP pt)
    2 points
  3. however with a little guidance it shouldn't be too hard if you can make a separate DCL file on the fly and use that. I use this, below, as a template, working through it to make them up as I need to. This is based on stuff from Lee Mac (and he should have the credit for that). Better check that there are no typos in there too. The basic idea is to make a temporary DCL file vi the LISP routine, I tend to save them in the windows temp folder (getvar "tempprefix"), and every now and then clear that. I'll also tend to call each DCL file a unique name for that LISP, and I have started adding a line to delete any previous temp files of that name before the LISP creates a new one. You can use any method you want to create the DCL file (which is a text file with an extension .dcl), the example below is credit to Lee Mac - I took out this code from one of his. (defun c:aDCL( / dcl des dch x) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Put preliminary bits here ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; create DCL pop up box ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (if (and (setq dcl (strcat (getvar "TEMPPREFIX") "DCL.dcl")) ;;rename DCL file as necessary (setq des (open dcl "w")) (foreach x '( " pass : dialog { key = \"DialogueKey\"; label = \"Dialogue Label\"; " " spacer;" ;;;;; Add DCL tiles here ;;;;; ;;Building Block Examples: " : boxed_column { label = \"\"; width = 60; " " }" " : row {alignment = top; wisth = 30; " " }" " : text { key = \"TextKey\";}" " : image_button { key = \"ImgButton\"; label = \"Image Button\"; alignment = centered; height = 5; width = 10; fixed_width = true; fixed_height = true;}" " : toggle {key = \"Toggle\"; label = \"Toggle\"; alignment = left; value = 1;}" " : edit_box { key = \"EditBox\"; label = \"Edit Box\"; width = 25; fixed_width = true;}" " : popup_list { key = \"Popup_list\"; label = \"Popup List\"; height = 6; fixed_height = true; width = 22; fixed_width = true;}" " : list_box {key = \"ListBox\"; label = \"list Box\"; height = 12; fixed_height = true; width = 38; }" " : button { key = \"OK\"; label = \"OK\"; is_default = true; is_cancel = true; fixed_width = true; width = 20; }" " : button { key = \"cancel\"; label = \"Cancel\"; is_default = false; is_cancel = true; fixed_width = true; width = 20; }" ;;;;; End DCL tiles here;;;;; " }" ;; End pass : dialog ) ;; end '( (write-line x des) ) ;;end foreach x (not (setq des (close des))) (< 0 (setq dch (load_dialog dcl))) (new_dialog "pass" dch) ) ;;End of DCL 'and' (progn ;;;;; Add Tile actions here ;;;;;; (set_tile "TextKey" "text") (action_tile "OK" "(done_dialog 1)") ;;can change variables here or run other code (action_tile "cancel" "(done_dialog 0)") ;;;;;end tile actions here;;;;; (start_dialog) ) ;;end of DCL 'progn' above (princ "\nError. Unable to load dialogue box.") ) ;;end of DCL 'if' above (vl-file-delete dcl) ;;delete the temp DCL file ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; End DCL pop up box ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Add rest of code here ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (princ "OK") )
    1 point
  4. I can imagine merging dcl in your lisp file can be a little overwhelming when you're new to lisping but then again, we've all been there
    1 point
  5. change (setq dlg-id (load_dialog "BricsCAD Scripts\Tools\Dialogs\SignalCalculator.dcl")) to the correct / new path or place 'SignalCalculator.dcl' in a folder that is in one of your support paths (options) and use something like : (If (setq fn (findfile "SignalCalculator.dcl")) (setq dlg-id (load_dialog fn)) (alert "Dialog SignalCalculator.dcl not found"))
    1 point
  6. Same here With a bit more info: "File: %<\\AcVar Filename \\f \"%tc3%fn7\">% printed by %<\\AcVar Login>% on %<\\AcVar PlotDate \\f \"M/d/yyyy h:mm:ss tt\">% using AutoCAD Version: %<\\AcVar acadver>%"
    1 point
  7. This is what I use (menucmd "M=$(edtime, $(getvar,date),DD-MO-YYYY - HH:MM:SS AM/PM)") --edit For file name replaced the / with - in the date so it won't error
    1 point
  8. Maybe its because I didn't have (vl-load-com) its there now. but everything is working on this end. https://ibb.co/j8HPK1x @lrm bounding box is for the text only.
    1 point
  9. This will ask you to select a text but it could be anything really find the midpoint of the bounding box around selected item ask for polylines to be selected make a copy the first selected item to the geo center of the polylines ;;----------------------------------------------------------------------------;; ;; Copy text to the geo center of polyline(s) (defun C:foo (/ txt BP SS poly PT newtxt) (vl-load-com) (setq txt (vlax-ename->vla-object (car (entsel "\nSelect Text to Move")))) (vla-getboundingbox txt 'minpt 'maxpt) (setq BP (mapcar '/ (mapcar '+ (vlax-safearray->list minpt) (vlax-safearray->list maxpt)) '(2 2 2))) ;midpoint of text (prompt "\nSelect Polyline") (if (setq SS (ssget '((0 . "*POLYLINE")))) (foreach poly (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS))) (setq PT (osnap (vlax-curve-getStartPoint poly) "gcen")) (setq newtxt (vla-copy txt)) (vla-move newtxt (vlax-3d-point BP) (vlax-3d-point pt)) ) ) (princ) )
    1 point
  10. When I set EDGEMODE to zero it works fine.
    1 point
  11. 1 point
  12. Are all your lines on the same plane (same Z coordinate)
    1 point
  13. 1 point
  14. Is it plugged in "yes" Is it plugged in "yes" Is it plugged in "oops harry plugged in his phone"
    1 point
  15. I think simple answer is "NO", eDrawings appears to be a viewer so no programming interface, you need say a Bricscad or another clone if you don't want to go down the Autocad path, do not buy LT no excel link. If you can write a VBA macro in excel then you can do what you want, a dxf file is just a text file so can look for MTEXT and read the lines below for layer and textstring. Just open in Word and have a look. In below the textstring is "Heading" look for Mtext then 1 then next line. NOTE lots of spaces in the lines. MTEXT 5 40 330 1D 100 AcDbEntity 8 TEXT 100 AcDbMText 10 796.131475 20 18.866797 30 0.0 40 18.0 41 797.031475 46 25.366797 71 3 72 5 1 HEADING
    1 point
  16. "but have had an error " no Laydel in Bricscad V20 maybe in latest version.
    1 point
  17. Notice that Whatsapp is down worldwide right now. If whatever you're trying doesn't work right now...
    1 point
  18. The same here, I don't have whatsapp, but taking this a step further no smart phone either (however I have no fear with my phone that when I am out and about I am not going to trash another £500 phone bashing it off a rock). Working from the most common upwards every mobile has text messaging, and I think pretty much all of them accept plain text emails (even mine!) and I would go for that route.
    1 point
  19. I dont have whatsapp ! Don't intend to get it either. Nor will I get all the other ones as well. Like Zoom,Ms-Teams, we-transfer, Blockbox and cloud services its a end user preference which ones you use, if you have a company phone I would expect you will have email.
    1 point
  20. For primary entities only, use a combination of tblobjname & entnext: (defun blockcomponents ( blk / ent lst ) (if (setq ent (tblobjname "block" blk)) (while (setq ent (entnext ent)) (setq lst (cons ent lst)) ) ) (reverse lst) ) Call the above with a block name argument, e.g.: _$ (blockcomponents "YourBlockName") (<Entity name: 7ffff706950> <Entity name: 7ffff706960> <Entity name: 7ffff706970>) To include nested objects, check for the presence of a block reference (INSERT) entity and include a recursive call, e.g.: (defun blockcomponents ( blk / ent enx lst ) (if (setq ent (tblobjname "block" blk)) (while (setq ent (entnext ent)) (if (= "INSERT" (cdr (assoc 0 (setq enx (entget ent))))) (setq lst (vl-list* (blockcomponents (cdr (assoc 2 enx))) ent lst)) (setq lst (cons ent lst)) ) ) ) (reverse lst) ) The above will return a list of entity names with sublists containing the entity names corresponding to the components of nested block references, e.g.: _$ (blockcomponents "block1") (<Entity name: 7ffff7069f0> <Entity name: 7ffff706a00>) _$ (blockcomponents "block2") (<Entity name: 7ffff706a50> (<Entity name: 7ffff7069f0> <Entity name: 7ffff706a00>) <Entity name: 7ffff706a60> <Entity name: 7ffff706a70>) _$ (blockcomponents "block3") (<Entity name: 7ffff706ad0> (<Entity name: 7ffff706a50> (<Entity name: 7ffff7069f0> <Entity name: 7ffff706a00>) <Entity name: 7ffff706a60> <Entity name: 7ffff706a70>) <Entity name: 7ffff706ae0> <Entity name: 7ffff706af0>) Here, Block1 is nested within Block2 is nested within Block3. If you don't want the nested list structure, use append in place of vl-list*, e.g.: (defun blockcomponents ( blk / ent enx lst ) (if (setq ent (tblobjname "block" blk)) (while (setq ent (entnext ent)) (if (= "INSERT" (cdr (assoc 0 (setq enx (entget ent))))) (setq lst (append (blockcomponents (cdr (assoc 2 enx))) (cons ent lst))) (setq lst (cons ent lst)) ) ) ) (reverse lst) ) This now returns a flat list: _$ (blockcomponents "block1") (<Entity name: 7ffff7069f0> <Entity name: 7ffff706a00>) _$ (blockcomponents "block2") (<Entity name: 7ffff706a50> <Entity name: 7ffff706a00> <Entity name: 7ffff7069f0> <Entity name: 7ffff706a60> <Entity name: 7ffff706a70>) _$ (blockcomponents "block3") (<Entity name: 7ffff706ad0> <Entity name: 7ffff706a70> <Entity name: 7ffff706a60> <Entity name: 7ffff7069f0> <Entity name: 7ffff706a00> <Entity name: 7ffff706a50> <Entity name: 7ffff706ae0> <Entity name: 7ffff706af0>)
    1 point
  21. I end up posting these all over the forum, so I might as well post a lot of them in one place for those who are interested. _________________________________________________________ Explanation of the Apostrophe: http://www.cadtutor.net/forum/showpost.php?p=258390&postcount=20 Explanation of Logand/Logior: http://www.cadtutor.net/forum/showpost.php?p=298061&postcount=8 Working with Attributes: http://www.cadtutor.net/forum/showpost.php?p=330778&postcount=2 Explanation of Conditionals (CAB/Lee Mac) http://www.cadtutor.net/forum/showpost.php?p=173196&postcount=10 http://www.cadtutor.net/forum/showpost.php?p=240943&postcount=2 http://www.cadtutor.net/forum/showpost.php?p=273108&postcount=12 Selection Set to List http://www.cadtutor.net/forum/showpost.php?p=248285&postcount=2 Block rename: http://www.cadtutor.net/forum/showpost.php?p=242147&postcount=24 VL Method Differences: http://www.cadtutor.net/forum/showpost.php?p=258403&postcount=9 Starting LISP: http://www.afralisp.net/ http://www.jefferypsanders.com/autolisptut.html http://ronleigh.info/autolisp/index.htm More Advanced LISP Tutorials/Help: http://augiru.augi.com/content/library/au07/data/paper/CP311-4.pdf http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-4.html http://www.cs.cmu.edu/afs/cs.cmu.edu/project/ai-repository/ai/html/cltl/clm/node1.html DCL Tutorials: http://www.jefferypsanders.com/autolisp_DCL.html http://www.afralisp.net/ Visual LISP Editor: http://www.afralisp.net/vl/vlisp.htm http://www.afralisp.net/vl/vl-edit.htm http://midpointcad.com/au/docs/lakose_The_Visual_LISP_Developers_Bible.pdf Error Handlers: http://www.afralisp.net/lispa/lisp6.htm http://www.cadtutor.net/forum/showthread.php?t=33966 http://www.cadtutor.net/forum/showpost.php?p=261049&postcount=3 -4 SelectionSets: http://www.afralisp.net/lisp/filter.htm http://www.theswamp.org/index.php?topic=28672.0 Layer Renaming: http://www.cadtutor.net/forum/showthread.php?t=38810 Attributes in VL: http://www.cadtutor.net/forum/showpost.php?p=259620&postcount=9 PaperSpace/ModelSpace Objects: http://www.cadtutor.net/forum/showpost.php?p=259934&postcount=13 Vla-File-Systime: http://www.cadtutor.net/forum/showthread.php?t=38331 Linking Objects with XData: http://www.cadtutor.net/forum/showpost.php?p=251211&postcount=12 Explanation of a LISP function (Text replacement): http://www.cadtutor.net/forum/showpost.php?p=264546&postcount=15 Explanation of a LISP function (Text Height Change): http://www.cadtutor.net/forum/showpost.php?p=306576&postcount=14 Explanation of a LISP function (Reinsert all blocks @ 0,0,0): http://www.cadtutor.net/forum/showpost.php?p=309366&postcount=15 SSGet Available Options: http://www.theswamp.org/index.php?topic=29972 Localising Variables: http://www.cadtutor.net/forum/showpost.php?p=265649&postcount=4 Express Tools Functions: http://www.afralisp.net/lisp/acet-utils.htm http://www.theswamp.org/index.php?action=dlattach;topic=28777.0;attach=12477 http://www.theswamp.org/index.php?topic=13719.0 http://www.theswamp.org/index.php?topic=19505.0 Entmake: http://www.theswamp.org/index.php?topic=4814.0 Undocumented LISP Functions: http://www.manusoft.com/cgi-bin/NoFrames.pl?referer=http://www.manusoft.com/resources/AcadExposed/Index.stm&header=Header.stm&toc=TOC.stm&main=Main.stm#AutoLISP Auto-Loading LISP (ACADDOC.lsp etc): http://www.theswamp.org/index.php?topic=9211.0 http://www.theswamp.org/index.php?topic=20492.0 http://www.cadtutor.net/faq/questions/53/How+do+I+automatically+load+variables%3F AutoCAD Command Prefixes: http://www.cadforum.cz/cadforum_en/qaID.asp?tip=2425 Deleting DWS Associations: http://www.cadtutor.net/forum/showthread.php?t=43380 Car/Cadr/Caddr Explained: http://ronleigh.info/autolisp/afude09.htm http://www.theswamp.org/index.php?topic=31473.0 Default Options: http://www.cadtutor.net/forum/showthread.php?t=39634 Script Writer: http://www.cadtutor.net/forum/showpost.php?p=295487&postcount=23 Demise of VBA: http://www.cadtutor.net/forum/showthread.php?t=32857 Command Vs Entmake Vs VL: http://rkmcswain.blogspot.com/2007/12/command-vs-entmake-vs-vla-add.html Explanation of Boole Function: http://www.cadtutor.net/forum/showpost.php?p=306339&postcount=9 Varying ways to Change Text Height: http://www.cadtutor.net/forum/showpost.php?p=296877&postcount=4 What are vl*,vlax* etc?: http://www.cadtutor.net/forum/showpost.php?p=318549&postcount=2 Setq Vs. Set: http://www.theswamp.org/index.php?topic=27226.msg328322#msg328322 AutoCAD Animation: http://www.cadtutor.net/forum/showthread.php?t=45146 http://www.cadtutor.net/forum/showthread.php?t=1202 http://www.cadtutor.net/forum/showthread.php?t=883 Safearrays/Variants: http://www.theswamp.org/index.php?topic=31674.0 http://www.theswamp.org/index.php?topic=29248.0 DDAtte2 (with visibility toggles): http://www.cadtutor.net/forum/showpost.php?p=308469&postcount=5 _________________________________________________________ Enjoy! Lee
    1 point
  22. I should probably add this too: http://www.theswamp.org/index.php?topic=24700.0
    1 point
×
×
  • Create New...