Recent Posts

Pages: [1] 2 3 ... 10
1
AutoLISP (Vanilla / Visual) / Re: Issue with Layout - Copy Command
« Last post by BIGAL on May 16, 2024, 09:33:25 PM »
No idea use copy layout a lot, but I am not on 2025, maybe (setvar 'ctab "Template") 1st then do copy layout.
2
AutoLISP (Vanilla / Visual) / Re: broke (Lee Macs) ScriptWriterV1-2.lsp
« Last post by Lonnie on May 16, 2024, 06:39:06 PM »
Tell me do you ever get tired of thanks?

(getvar 'ROAMABLEROOTPREFIX)
"C:\\Users\\lshaw\\AppData\\Roaming\\Autodesk\\AutoCAD 2025\\R25.0\\enu\\"


Removed
LMAC_WScript_V1.2.cfg
LMAC_WScript_V1.2.dcl
Reloaded and it works.


Thank you.


Double thank you.
"\\\\DT-LSHAW2\\dcapps"

works just fine in the cfg file.

PS it may be old but it's still a great tool





3
AutoLISP (Vanilla / Visual) / Re: broke (Lee Macs) ScriptWriterV1-2.lsp
« Last post by Lee Mac on May 16, 2024, 06:06:49 PM »
Try removing the corresponding LMAC_ prefixed files from the Support folder under ROAMABLEROOTPREFIX.

I must say the program is old and in dire need of improvement  :|
4
AutoLISP (Vanilla / Visual) / broke (Lee Macs) ScriptWriterV1-2.lsp
« Last post by Lonnie on May 16, 2024, 04:46:27 PM »
I was attempting to run off a UNC and I crashed my modified lisp. I now can not get his original to run (Even when I download a new file). It loads fine but here is what happens.

Command: WSCRIPT

** Error: bad argument type: stringp nil **

I went so far as to remove autocad from my registry and recreate it. Still no joy.

I also tried setting all the local vars back to ""
5
AutoLISP (Vanilla / Visual) / Re: Line between 2 endlines
« Last post by ribarm on May 16, 2024, 01:21:40 PM »
...so I end up with crossing lines instead of parallel lines...

I can not replicate this situation... Can you post *.DWG where this occur... Only small segment, not entire *.DWG as it could be forbidden sharing - if you work at such position in your organisation...
6
AutoLISP (Vanilla / Visual) / Re: Line between 2 endlines
« Last post by FS_AT12 on May 16, 2024, 12:59:43 PM »
It could be that I made mistake with (set) function... It requires symbols instead of lists... Corrected now and it should work...
OP, what do you mean - not create any lines at all? It's clearly written in my code : (command "_.line" ... )

Hi Ribarm, this was a reaction to the post of dexus.

Nevertheless, after your edit, it works fine as I tested it in some cases.
I do not get the error any more, it works on lines and on polylines (great!).
In some situations I get a wrong connection, so I end up with crossing lines instead of parallel lines, and 4 points are created.

Thank you!
7
AutoLISP (Vanilla / Visual) / Re: Line between 2 endlines
« Last post by FS_AT12 on May 16, 2024, 12:46:13 PM »
Dear ribarm,

Thank you for your prompt reply.
In 99% of the selections I get this
I get this Error:

(LIST PT4 PT3)
; in file :
; C:\Users\...\connect_with_lines.lsp
;
; error : bad argument type <(301.187543505381 100.629323961606 0.0)> ; expected <SYMBOL> at [set]
:

the lisp is failing if the lines are not parallel, or the lines are  polylines,
I really dont know why it is not working.
The original lisp I have posted, works in every situation. Connect_with_lines & the test lisp (dexus) are failing in nearly every situation, I do not really understand why?

8
AutoLISP (Vanilla / Visual) / Re: Line between 2 endlines
« Last post by ribarm on May 16, 2024, 12:37:45 PM »
It could be that I made mistake with (set) function... It requires symbols instead of lists... Corrected now and it should work...
OP, what do you mean - not create any lines at all? It's clearly written in my code : (command "_.line" ... )
9
AutoLISP (Vanilla / Visual) / Re: Line between 2 endlines
« Last post by FS_AT12 on May 16, 2024, 12:20:28 PM »
Dear dexus,
Thank you for the link. I like the behaviour that you can select multiple lines at once, this accelerates the procedure.
I have tested it.
For me, it is not working, since the Lines in the architectural drawings are from "old buildings" based on measurements, none of the lines are parallel to each other, (just a very little number).
The lisp is not creating any line. -(
10
AutoLISP (Vanilla / Visual) / Re: Apply Plot style table to all layout
« Last post by Lonnie on May 16, 2024, 11:59:34 AM »
Added checking if the plot style exists.

I was messing with changing page setup when I saw this. Since this was played with today I thought why not?

Removed case sensitivity

Code: [Select]
(setq ctbLower (strcase ctb nil))
(setq installedPsLower (mapcar '(lambda (ps) (strcase ps nil)) installedPs))

Code: [Select]
(if (/= nil (vl-position ctbLower installedPsLower))


Code: [Select]
;;----------------------------------------------------------------------;;
;; setPlotStyle FUNCTION
;; https://www.theswamp.org/index.php?topic=45000.msg502065#msg502065
;; Added checking if the plot style exists by 3dwananb on 2024.05.15

(defun setPlotStyle (ctb / CurDoc installedPs ctbLower installedPsLower)
  ;; Get the active document
  (setq CurDoc (vla-get-ActiveDocument (vlax-get-acad-object)))
  ;; Get the list of installed plot styles
  (setq installedPs (vlax-safearray->list (vlax-variant-value (vla-GetPlotStyleTableNames (vla-get-ActiveLayout CurDoc)))))

  ;; Convert the input plot style name and the list of installed plot styles to lowercase for case-insensitive comparison
  (setq ctbLower (strcase ctb nil))
  (setq installedPsLower (mapcar '(lambda (ps) (strcase ps nil)) installedPs))

  ;; Check if the specified plot style exists in a case-insensitive manner and set it
  (if (vl-position ctbLower installedPsLower)
    (progn
      (princ (strcat "\nPlot Style successfully set to: '" ctb "'\n"))
      (vlax-map-collection
        (vla-get-Layouts CurDoc)
        '(lambda (x) (vla-put-StyleSheet x ctb))
      )
    )
    (progn
      (princ (strcat "\nPlot Style '" ctb "' not found!\n"))
      ;; Print the available plot style tables if the specified plot style is not found
      (princ "\nAvailable plot style tables:\n")
      (mapcar '(lambda (ps) (princ (strcat ps ""))) installedPs)
    )
  ) ;; If plotstyle exists, set it; otherwise, print available plot styles.
)

;; Example invocation
(setPlotStyle "monochrome.ctb")



Before I did that I added the list of files to look at trying to figure out why it failed.

Code: [Select]
(setq CurDoc (vla-get-ActiveDocument (vlax-get-acad-object)))

Code: [Select]
(setq installedPs (vlax-safearray->list (vlax-variant-value (vla-GetPlotStyleTableNames (vla-get-ActiveLayout CurDoc)))))
Pages: [1] 2 3 ... 10