Sửa lỗi error bad argument type stringp nil

Ok a couple of suggestions you can redefine Autocad commands so you can do your own "open" and "close".

As part of your logout you should save and close.

I would normally use (write-line rather than (princ.

A blank line (write-line "" fp)

(defun c:login (/ file a time1 c d fp) (setq file (findfile "D:\AfralispTut\log.txt")) (if (not file)

 (open "D:\\AfralispTut\\log.txt" "w")
) (setq a (TODAY))
  time1 (TIME)
  c (getvar "dwgname")
  d (strcat "Drg Start   " a "  -  " time1 "  -  " c)
) (if (/= c "Drawing.dwg") (progn
   (setq file (findfile "D:\\AfralispTut\\log.txt")
         fp (open file "a")
    )
   (write-line d fp)
   (write-line "" fp)
   (close fp)
   (write-line (strcat "\nLogged in at: " time1))
 )
) (princ) ) (defun c:logout (/ file a time2 c d fp) (setq a (TODAY) time2 (TIME)
  c (getvar "dwgname")
  d (strcat "Drg Exit   " a "  -  " time2 "  -  " c)
) (if (/= c "Drawing.dwg") (progn
   (setq file (findfile "D:\\AfralispTut\\log.txt")
         fp (open file "a")
    )
   (write-line d fp)
   (write-line "" fp)
   (close fp)
   (write-line (strcat "\nLogged out at: " time2))
   (etime)
 )
) (princ) ) (defun ETIME ( / hr1 m1 s1 tot1 hr2 m2 s2 tot2 total ht mt file fp) (setq hr1 ( 60 ( 60 (atof (substr time1 1 2))))
  m1 (* 60 (atof (substr time1 4 2)))
  s1 (atof (substr time1 7 2))
  tot1 (+ hr1 m1 s1)
 hr2 (* 3600 (atof (substr time2 1 2)))
  m2 (* 60 (atof (substr time2 4 2)))
  s2 (atof (substr time2 7 2))
  tot2 (+ hr2 m2 s2)
  total (- tot2 tot1)
  hr1 (/ total 3600)
  ht (fix hr1)
  hr1 (- hr1 ht)
  mt (* hr1 60)
  ht (rtos ht)
  mt (rtos mt)
) (setq d (strcat "Editing Time This Session : " ht " Hours and " mt " minutes")) (setq file (findfile "D:\AfralispTut\log.txt")
  fp (open file "a")
) (write-line d fp) (write-line "" fp) (write-line "==============================================================" fp) (write-line "" fp) (close fp) (princ) ) ;calculate the current date (defun TODAY (/ d yr mo day)
(setq d (rtos (getvar "CDATE") 2 6)
      yr (substr d 3 2)
      mo (substr d 5 2)
      day (substr d 7 2)
  )
(strcat day "/" mo "/" yr)
) ;calculate the current time (defun TIME (/ d hr m s)
 (setq d (rtos (getvar "CDATE") 2 6)
       hr (substr d 10 2)
        m (substr d 12 2)
        s (substr d 14 2)
  )
(strcat hr ":" m ":" s)
) (princ)
     
There is something wrong in the etime calcs did not spend a lot of time.

Drg Start 03/03/20 - 19:05:23 - Drawing1.dwg Drg Exit 03/03/20 - 19:05:39 - Drawing1.dwg Editing Time This Session : 0 Hours and 43.883 minutes

change (defun etime ( / ) then you can check each variable after running using a simple method type ! then variable !ht !hr1, check the answer, rtos for me (rtos ht 2 0)

Please any one help me with this code am trying to load it into autocad but giving me this error.

(setq lect "c:\\AutoFLUID2009\\") (load (strcat lect "ATF\\lm-ATF")) ;

(defun APPELCLE-SUITE() (princ))

(defun APPELCLE-T0() (princ))

(defun APPELCLE-0() (princ))

(defun APPELCLE-G() (princ))

(defun APPELCLE-T() (princ))

(defun APPELCLE-P() (princ))

(defun APPELCLE-1() (princ))

(defun APPELCLE-2() (princ))

(defun APPELCLE-A() (princ))

(defun APPELCLE-G0() (princ))

(defun APPELCLE-T0() (princ))

(defun APPELCLE-P0() (princ))

(defun APPELCLE-10() (princ))

(defun APPELCLE-20() (princ))

(defun AF-STOPSOFT-CLE() (princ))

(appel-du-menu-AF2009-suite)

(defun c:clef() (load "c:/code1.lsp") )

(princ "Coucou")

thank you

The solution to this error will depend on what you were doing (or trying to do) when you saw the error:

1. Ensure that the Microsoft Visual C++ Runtimes are up to date on your system.

If you've verified that you have the latest Microsoft Visual C++ Runtimes but you're still seeing the error, move on to the next step.

2. Close CAD.

3. With CAD still closed, open your LandFX folder.

Locate and open a file named _install_.xml.

Your LandFX folder might be located on your computer, on an office server, or on a shared online folder. Not sure where it is? Ask your IT administrator or CAD manager.

Sửa lỗi error bad argument type stringp nil

Sửa lỗi error bad argument type stringp nil

4. The file will open in your default text application, such as Notepad.

Verify that the information in the file, including your office's Land F/X Support ID, is complete in the file.

5. If any information, such as your Support ID, is missing from the _install_.xml file, close the file and locate it in your LandFX folder. Change the file's name, giving it the name _install_.xmlOLD.

Sửa lỗi error bad argument type stringp nil

6. Locate a file named _install_.xml.bak. Change this file's name to _install_.xml (don't forget the underscores).

Sửa lỗi error bad argument type stringp nil

7. Open CAD. Can you access your Land F/X tools without errors? If so, you've resolved the issue.

Still getting the error? Move on to the next step.

8. Copy the following text, including the parentheses, and paste it into the Command line: (getenv "username")

Press Enter.

If you now see the text 'nil' in the Command line, complete the following steps to resolve the error:

8A. Follow our steps to uninstall CAD.

Follow steps 1 through 5 in the article linked above, including deleting all additional registries and files. Do not reinstall CAD quite yet – you'll do that after the next step.

8B. Follow our steps to uninstall the F/X Workstation component.

8C. Now reinstall your version of CAD.

If you're reinstalling AutoCAD (not F/X CAD), you'll need to reinstall the F/X Workstation component to be able to see your Land F/X menus. The F/X Workstation component is included in the F/X CAD installer, so F/X CAD users won't need to reinstall F/X Workstation at this point.

Check whether your plant layers are locked – especially if you received the error when attempting to use our Verify Labels tool.

Here's an example of several locked plant layers as shown in the Layers Properties Manager:

Sửa lỗi error bad argument type stringp nil

If your plant layers are locked, unlock them. For instructions, see our documentation section.

Once you've unlocked your plant layers (if applicable), run the Verify Labels tool. If it functions correctly, you've resolved the issue.

If you are able to use the software (ruling out the damaged XML file) and your plant labels are all unlocked (ruling out the locked layers issue), our Color Render tool may be causing the problem. Do you have Color Render turned on? Read on.

1. Our Color Render tool can also cause this error from time to time. Your next step should be to for now.

Sửa lỗi error bad argument type stringp nil

2. Now repeat the action that generated the error. You should be able to complete that step without seeing the error message.

This error can also occur as a result of clicking the OK button in the Colorization dialog box when no plant color symbols have been assigned. In this case, the drawing will still appear with 2D symbols instead of color symbols, but will be in Color Render mode and potentially cause this error. You should still perform the troubleshooting step of clicking Turn Off Color – even if the plan doesn't look colorized – which may very well resolve the issue.

You can turn Color Render back on when ready to present your design.

You saw this error because the block you tried to place is saved in the main Discipline Graphics folder (LandFX/Blocks/discipline_graphics) instead of one of its subfolders.

Move the block's source files to a subfolder within the folder discipline_graphics, such as user_defined. You should now be able to place the block without seeing the error.

Sửa lỗi error bad argument type stringp nil

If none of the other scenarios listed above apply, or if you've followed the solution steps and you're still seeing the error, you most likely have corruption in your drawing.

Follow our steps to clean your drawing and all Xrefs.

Open the clean file and attempt the same action that generated the error. If you're not getting the error, you've cleaned your drawing successfully and can keep working in the clean drawing.

Don't want to clean your drawing? You can try to replicate the error in a blank drawing. Take care to open the blank drawing based on either the acad.dwt (Imperial units) or acadiso.dwt (metric units) templates. Repeat the action that seemed to cause the error, such as placing a plant or generating a Reference Notes Schedule – whatever you tried to do when you saw the error. If you don't see the error in the blank drawing, you're likely facing drawing corruption in the original drawing where you saw the error, and will need to clean it anyway.