Author Topic: Importing Layer controls without opening drawings  (Read 10217 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Importing Layer controls without opening drawings
« Reply #30 on: July 14, 2014, 12:56:53 PM »
Lets have some fun here! I have tested the lsp. I can load up the files and then it saves the files but it seems that it does not re-path the xref to the new location. So for example original sheet name: 1234.1234.sheet1.dwg and 1234.1234.base.dwg, I copy to a new location of 2222.2222.sheet1.dwg with the base files, 2222.2222.base.dwg.
I then run the lsp. it would re-path the xref(s) to the new location. Do I need to specify the old job no and the new job no?
Civil3D 2020

Lee Mac

  • Seagull
  • Posts: 12912
  • London, England
Re: Importing Layer controls without opening drawings
« Reply #31 on: July 14, 2014, 01:06:32 PM »
Lets have some fun here! I have tested the lsp. I can load up the files and then it saves the files but it seems that it does not re-path the xref to the new location.

Of course it doesn't - you did not specify any information about the format of the job number to be replaced, or what value it should be replaced with. So unless your xref paths coincidentally contained the string "oldjobnumber" as specified in the code, the program would not have done anything at all.

So for example original sheet name: 1234.1234.sheet1.dwg and 1234.1234.base.dwg, I copy to a new location of 2222.2222.sheet1.dwg with the base files, 2222.2222.base.dwg.
I then run the lsp. it would re-path the xref(s) to the new location. Do I need to specify the old job no and the new job no?

Yes, these are noted in the code.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Importing Layer controls without opening drawings
« Reply #32 on: July 14, 2014, 01:15:06 PM »
lol. my bad. Let me try again! :ugly:
Civil3D 2020

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Importing Layer controls without opening drawings
« Reply #33 on: July 14, 2014, 01:23:48 PM »
Code: [Select]
Ok. I have tried it once again manually putting the job no in. Still no luck. It is revising the files to a degree I can see the date modified update.

[code(defun c:test ( / lst )
    (if (setq lst (LM:getfiles "Select drawings to process" "" "dwg;dwt;dws"))
        (LM:odbx
           '(lambda ( doc / str )
                (vlax-for blk (vla-get-blocks doc)
                    (if (and (= :vlax-true (vla-get-isxref blk))
                             (wcmatch (setq str (vla-get-path blk)) "*1234.1234*")
                        )
                        (vla-put-path blk (vl-string-subst "2222.2222" "1234.1234" str))
                   )
                )
            )
            lst t
        )
    )
    (princ)
)


Does \ could this be edited in the command line? oldjob newjob
Civil3D 2020

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Importing Layer controls without opening drawings
« Reply #34 on: July 16, 2014, 09:46:20 AM »
Ok. I have another one for you. Still with this bad boy! How about making it (purge all and purge registered apps, audit, fix errors if any and then save). I tell me head is on fire!
Civil3D 2020