Jump to content

Leaderboard

Popular Content

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

  1. Happy codig... wasn't happy earlier when it wasn't working...
    1 point
  2. when handling files the findfile function can make sure / verify you have the correct file(name) like (if (setq file (findfile file)).... and of course you must make sure , as suggested by master Lee that a file is not in use / locked and also you have write permission , both on the file and in the folder. Good luck & happy coding.
    1 point
  3. Firstly, to clarify: there is no difference in the data type of the data returned by a get_tile expression for an edit_box DCL tile (or equivalently the $value symbol referenced as part of an action_tile statement), and the string used to represent a filename and/or filepath - both are merely strings. To help you diagnose the issue, I would suggest using the following function: ;; Check if the output file is opened (defun PDFOpened ( PDFOfilename ) (vl-file-rename PDFOfilename PDFOfilename) ) ;; Starting the PDF LISP ;; Checks if the DWG file has a PDF with the same name that is open (defun PDFgetfilename ( / fn ) (setq fn (strcat (getvar "dwgprefix") (vl-filename-base (getvar 'dwgname)) ".pdf")) (prin1 fn) (if (PDFOpened fn) (alert (strcat fn " is open\nPlease close it or rename the output file")) ) fn ) ;; When the DCL bos is open, I can change the file name, ;; Check if the new filename is open as a PDF: (defun PDFFileNameCheck ( / fn ) (setq fn (strcat (get_tile "Location") (get_tile "afilename") ".pdf")) (prin1 fn) (if (PDFOpened fn) (alert (strcat fn "\nis open. Please use a different name or close the PDF file.")) ) fn ) The use of the prin1 function shows you the raw AutoLISP data, rather than the output rendered by the string interpreter.
    1 point
  4. Thanks, we all have brain farts from time to time.
    1 point
  5. Perhaps try something like: (defun CP:crea_xrecord (nome / dict_name anXrec) (if (setq dict_name (cdr (assoc -1 (dictsearch (namedobjdict) "Solaio Pipp")))) (progn (setq anXrec (entmakex (append '((0 . "XRECORD")(100 . "AcDbXrecord")) (apply 'append (mapcar '(lambda (x / v) (if (setq v (eval (cadr x))) (mapcar 'cons (list 1 (nth (vl-position (type v) '(INT REAL LIST STR)) '(70 40 10 1))) (list (car x) v)))) '( ; list <key> <val> ("altezza soletta" (dcl-Control-GetText Pipp/Main/h)) ("alleggerimento" (dcl-Control-GetText Pipp/Main/tipo_alleggerimento)) ("copriferro inf" (dcl-Control-GetText Pipp/Main/c)) ; ... ("altezza gabbia" (atoi (AX:getvars_single "Alleggerimenti" "def_all" 305))) ("riduzione peso" (atoi (AX:getvars_single "Alleggerimenti" "def_all" 301))) ; ... ) ) ) ) ) ) (dictadd dict_name nome anXrec) ) ) ) And to obtain the value use something like: (cdadr (member '(1 . "altezza gabbia") (entget xrec)))
    1 point
  6. Welcome to your new home at CADTutor! I do hope you'll like the new forum software we're using, it provides a raft of new, modern tools that we didn't have before and it brings our community right up-to-date in terms of web apps. You'll find quite a lot of changes but the content and the members are all the same. I've also tried hard to make it look familiar, using the same style as our old home. Do take some time to look around and see what's on offer. If you have any questions about the change or if you spot anything odd, just let me know. The migration process is fearfully complicated and it's possible that some small tweaks may still be required, so don't assume everything is perfect. Things to bear in mind POST COUNT: Long-time members (those who have been here for more than 10 years) may find that their post count has gone down. The reason for this is that all content more than 10 years old has been archived. There are two reasons for this; first, it helps to make the forum run more smoothly with legacy content removed and second, it seemed unlikely that anything more than 10 years old was still relevant. PROFILE PHOTO: You'll notice that this software makes more use of your profile photo than the previous one. You'll also notice that the new profile photos are circular, in common with contemporary social media platforms. I'd encourage you to update your profile photo to reflect these changes. Simply go to your profile page and upload a new photo (250px X 250px) and you're good to go. LEADERBOARD: Some content and statistics will take a little while to generate, so if you go to the Leaderboard (for example) and see nothing there, that's just because the new forum is still collecting data. Those areas will be populated in a short while. FAQs: The FAQs in this forum were originally written for vBulletin software and are obviously now out-of-date. In time, these will be updated but I'm confident that the new software, Invision Community, is sufficiently intuitive that they may not be required at all. Thanks for your support, David
    1 point
×
×
  • Create New...