Jump to content

acaddoc.lsp help


KFesting

Recommended Posts

By the way, it is possible that you have another AutoLISP file with the same name but different extension? Please try this on command prompt and check if returns other than nil:

(findfile "flat.VLX")

(findfile "flat.FAS")

Link to comment
Share on other sites

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • KFesting

    16

  • MSasu

    13

  • 7o7

    3

  • hanhphuc

    1

Top Posters In This Topic

Posted Images

They both return a nil argument, and I am certain there are no other instances of any other filetypes other than .lsp files.

 

Also tried calling the flat.lsp file up in the acaddoc.lsp - didn't work either. I am stumped with this one.

Link to comment
Share on other sites

Also, is there a way of resyncing the acaddoc.lsp file without having to close and reopen AutoCAD? Thinking something similar to the 'reinit' command when chaning PGP files.

Link to comment
Share on other sites

Try to replace that with:

(load "C:\\Users\\EMPIRE\\documents\\lisp's\\flat.lsp")

If this doesn't works either, I really don't know what other solution to propose.

 

 

Also, is there a way of resyncing the acaddoc.lsp file without having to close and reopen AutoCAD?

To do that just call this statement:

(load "acaddoc.lsp")

Link to comment
Share on other sites

Just noticed that OP had posted above the source code of the trouble-maker tool; but seems that there is nothing wrong in that. This is confirmed also that the file is loaded on prompter without issues.

It is possible that the quote character (Lisp's) from path cause issues with automatic loading?!? KFesting, can you please try to remove the quote form you repository name and try again?

Link to comment
Share on other sites

Hi MSasu,

 

Not to sure what you mean here - are you suggesting the apostrophe is causing issues in the file directory?

 

I've just tried loading the actual acaddoc.lsp file to refresh it - interestingly enough received the below message.

 

Command: (findfile "acaddoc.lsp")

"C:\\Users\\EMPIRE\\documents\\lisp's\\acaddoc.lsp"

 

Command: (load "acaddoc.lsp")

; error: bad character read (octal): 0

Link to comment
Share on other sites

So, seems that you have an error message after all.

I may be that the issue is in fact in the 5th file (said "vectpdf.lsp") which doesn't load completely? Can you post its code here?

Link to comment
Share on other sites

This is the code so far in my acaddoc.lsp file:

 

(load "EFROZEOFF")
(load "ROTMULT")
(load "MT2ML")
(load "VPLOCKTOGGLE")
(load "VECTPDF")
(load "flat")
(load "STRIKETHROUGH")
(load "STRIPMTEXT")
(load "XFD")

 

And this is the code in the 5th file (flat):

 

;   Flatten a 3D drawing 
;   Written by Eduard 
;   This command will set all elevations and points to zero, efectively flattening any 3D drawing. 
; 
(defun c:flat (/ total-nabor) 
 (vl-load-com) 
 (if 
   (setq total-nabor (ssget "x" '((410 . "model")))) 
    (progn 
      (setq total-nabor 
       (mapcar 'vlax-ename->vla-object 
         (mapcar 'cadr 
           (ssnamex total-nabor) 

         ) ;_ end of mapcar 
       ) ;_ end of mapcar 
      ) ;_ end of setq 
      (foreach  i '(1e99 -1e99) 
  (mapcar (function (lambda (x) 
          (vla-move x 
              (vlax-3d-point (list 0 0 0)) 
              (vlax-3d-point (list 0 0 i)) 
          ) ;_ end of vla-move 
        ) ;_ end of lambda 
    ) ;_ end of function 
    total-nabor 
  ) ;_ end of mapcar 
      ) ;_ end of foreach 
    ) ;_ end of progn 
 ) ;_ end of if 
 (princ) 
) ;_ end of defun

 

 

Although the actual 'flat' LISP file works fine if I load it in manually using APPLOAD.

Link to comment
Share on other sites

Sorry - that 'flat' file is actually the 6th LISP to load. The preceding 5 all load correctly - everything from FLAT onwards doesn't.

Link to comment
Share on other sites

The "flat.lsp" is the 6th, not the 5th one; you posted that code yesterday, too. You stated that the first 5 were loaded correctly, so I presumed that the issue is with the 6th one. Seems that this was a wrong assumption.

 

One solution to locate which file is causing that error message will be to load them one by one - commentall statements (that it, add a ";" in front) but one in your acaddoc.lsp and reload it; if works OK, then do the same with the next.

(load "efrozeoff")
[color=blue];[/color](load "rotmult")
[color=blue];[/color](load "mt2ml")

 

Please edit your previous post and add the code tags.

Link to comment
Share on other sites

Problem solved!

 

Looks like it was definitely the 5th one that was causing me issues (VECTPDF). I just had a look at the code and it is extremely messy (I don't really understand writing LISP routines myself and generally find them online for specific needs). This one actually renders a PDF as an image that can be then exploded into CAD lines etc. I won't even try and post it up on here but will attach the code in this post.

 

Funnily enough, loading that VECTPDF LISP routine in manually works fine...

 

Thanks for all of your help!

VECTPDF.lsp

Link to comment
Share on other sites

What you have there is an encrypted (by protect utility) AutoLISP code - something that was available for coders to protect their work prior to arrival of FAS/VLX compilation. So, the actual code isn't visible for debug.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...