Jump to content

Recommended Posts

Posted

Dear All,

I have nearly 400 layouts and in each sheet having total length and Start and End Chainage as a Patch length and we note down those patch length on excel sheet now is that possible to import those patch length from excel to autocad both excel and autocad file are attached here.

 

Patch length.dwg Patch length.xlsx

Posted
5 hours ago, pmadhwal7 said:

is that possible to import those patch length from excel to autocad both excel and autocad file are attached here.

Hi  pmadhwal7  , to import to?

 

Where do you need to import such text from the xls file? 

 

Do you mean to rename the layout ? 

 

Please , upload a sample DWG , with desired result. 

 

See attached dwg with the layout 01 changed to "Patch Length     90 (CH-0 TO CH-90)" 

 

Please consider to save the xls as CSV comma separated value, without head line, like the csv attached 

Patch length-new layout names.dwg Patch length-01-08.csv

Posted
4 hours ago, devitg said:

Hi  pmadhwal7  , to import to?

 

Where do you need to import such text from the xls file? 

 

Do you mean to rename the layout ? 

 

Please , upload a sample DWG , with desired result. 

 

See attached dwg with the layout 01 changed to "Patch Length     90 (CH-0 TO CH-90)" 

 

Please consider to save the xls as CSV comma separated value, without head line, like the csv attached 

Patch length-new layout names.dwg 299.06 kB · 0 downloads Patch length-01-08.csv 344 B · 0 downloads

Thanks for your kind reply i didn't want to change layout name i want to import patch length which was already note down in excel, if you check my dwg file so i mention in first sheet patch length which is noted down in excel  "Patch Length     90 (CH-0 TO CH-90)" other sheets having different patch length in compression to excel sheet i also attaching screen shot kindly help me

Annotation 2020-07-09 092758.jpg

Posted

Providing the text is at same location on ever sheet then easy just go to each layout check its number/name and make text. What is your layout name if its like layout1 then add that to excel. If the layout name is all over the place you can use layout order instead.

 

Do a csv export then its simple read the csv and (setvar 'ctab layoutnumber) (command "text" Pt .......)

 

Use lee-mac parse csv to make a list of the layout details. Then use foreach on the list very simple.

 

(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq tabs (vla-get-Layouts doc))
(while read csv
; make a list here from csv use (car (cadr get Y
(repeat (vla-get-count tabs)
(vlax-for lay tabs
(setq x (vla-get-taborder lay))
(setq tabname (vla-get-name lay))
(if (and (= y x) (/= tabname "Model"))
; add text now.

 

Posted
4 hours ago, BIGAL said:

Providing the text is at same location on ever sheet then easy just go to each layout check its number/name and make text. What is your layout name if its like layout1 then add that to excel. If the layout name is all over the place you can use layout order instead.

 

Do a csv export then its simple read the csv and (setvar 'ctab layoutnumber) (command "text" Pt .......)

 

Use lee-mac parse csv to make a list of the layout details. Then use foreach on the list very simple.

 


(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(setq tabs (vla-get-Layouts doc))
(while read csv
; make a list here from csv use (car (cadr get Y
(repeat (vla-get-count tabs)
(vlax-for lay tabs
(setq x (vla-get-taborder lay))
(setq tabname (vla-get-name lay))
(if (and (= y x) (/= tabname "Model"))
; add text now.

i tried readcsv lsp but not able to use can u please check it in my attached dwg,

Annotation 2020-07-09 165124.jpg

Patch length.dwg Patch length(1).xlsx

Posted
20 hours ago, pmadhwal7 said:

is that possible to import those patch length from excel to autocad both excel and autocad file are attached here.

Hi  pmadhwal7  , to import to?

 

Please clear , at your dwg , the patch length is at al 8 sheets 

 

image.thumb.png.5b8c5d6231d44d685e42f844d846d0c7.png

image.png.3f585ef4f4ba17d65ca1f3528f01f3e5.png

 

And a like , not equal text, is  at the XLS 

 

image.png.8ddc01f8233675c54d16e846866748e8.png

 

So, the task to do is: replace the  text at the DWG , by the text at the XLS . 

 

It seem to be that you are updating the dwg as it had be changed adding a new  LAYOUT's  between 2 or more existing layouts. 

 

Maybe if you could explain WHAT you have , and not HOW to do , it will clear us.

 

 

 

 

 

 

 

 

 

Posted
On 7/8/2020 at 2:53 PM, pmadhwal7 said:

is that possible to import those patch length from excel to autocad both excel and autocad file are attached here.

Hi  pmadhwal7  , 

 

Could it be so ?

 

 

 

Please consider to save the xls as CSV comma separated value, without head line, like the csv attached 

Patch length-patch changed.dwg Patch length-01-08.csv

Posted
11 hours ago, pmadhwal7 said:

and how can i able to import them in cad?

 

I ask if it could be so , if you agree, a lisp can be made . 

Posted (edited)

Whilst Devitg is correct pretty easy to change the text,  it would be way better if you made the Title block into a block with attributes, you could do so much more updating, the 1 of 500 split into two sheet number and total number, the total number being updated by either how many layouts or a number like 500. Start sheet number if multi dwgs. Yes you would have 2 -3 different functions but the code for the tasks already exists. The only change required is block name and tag name. By making a block eliminates the error of selecting text by a pt, if you dont have the title work at an exact pt then it may error.

 

Also for me with layouts and title blocks I set them up with lower left at 0,0 just for simplicity yours is at -177, 2.9 re read at an exact point.

 

Re 1st line in csv is header not a problem so long as always produced that way its a 50/50 question. For me leave in just do a dummy read 1st line.

 

If you can find time to do into a block lower left 0,0. Can provide some code.

image.png.5b36f4f8b5cad9430d66a89646ad0015.png

Edited by BIGAL
Posted
4 hours ago, BIGAL said:

Whilst Devitg is correct pretty easy to change the text,  it would be way better if you made the Title block into a block with attributes, you could do so much more updating, the 1 of 500 split into two sheet number and total number, the total number being updated by either how many layouts or a number like 500. Start sheet number if multi dwgs. Yes you would have 2 -3 different functions but the code for the tasks already exists. The only change required is block name and tag name. By making a block eliminates the error of selecting text by a pt, if you dont have the title work at an exact pt then it may error.

 

Also for me with layouts and title blocks I set them up with lower left at 0,0 just for simplicity yours is at -177, 2.9 re read at an exact point.

 

Re 1st line in csv is header not a problem so long as always produced that way its a 50/50 question. For me leave in just do a dummy read 1st line.

 

If you can find time to do into a block lower left 0,0. Can provide some code.

image.png.5b36f4f8b5cad9430d66a89646ad0015.png

 

Thanks for ur kind reply but it not possible to now to make it as a attribute block...anyway i will done it manually thanks all for help....

 

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...