Entering data from the .xlsx table in the title block

Entering data from the .xlsx table in the title block

ProRuzneDrobnosti
Contributor Contributor
900 Views
9 Replies
Message 1 of 10

Entering data from the .xlsx table in the title block

ProRuzneDrobnosti
Contributor
Contributor

Hi to all. I've been solving the problem of filling the title block with an .xls table for some time now (Thanks FINET_Laurent and Michael.Navara for their help with this). The best solution would be a function field in the title block that finds the name of the part shown on the drawing sheet in the .xls table and fills in the value for it from the corresponding column in the table. Is such solution possible?
Thank you very much!

0 Likes
901 Views
9 Replies
Replies (9)
Message 2 of 10

WCrihfield
Mentor
Mentor

Hi @ProRuzneDrobnosti.  You may have to provide a lot more information and details here, because the rest of us are not familiar with your previous posts.  You might also want to provide links here to those previous posts, to give us some idea what you are talking about.  Code needs to either be very specific, or vary dynamic to allow user input for it to work properly, without errors.  In order for someone to be able to edit your TitleBlock by code, we would need to be very familiar with your specific TitleBlock, because everyone has different ones, with different contents.  Also, for us to be able to find stuff in your Excel file by code, we would have to be very familiar with that specific Excel file, and how all its contents are laid out.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 10

ProRuzneDrobnosti
Contributor
Contributor

Very valid point, thank you! I am attaching a small part of the project with an .xls table (located in the middle, named Table1). Here and here are links to previous discussions

0 Likes
Message 4 of 10

ProRuzneDrobnosti
Contributor
Contributor

Hi to all! Does anyone have any ideas? I will be very grateful.

0 Likes
Message 5 of 10

A.Acheson
Mentor
Mentor

Hi @ProRuzneDrobnosti 

Alot of users will refrain from opening files for security risks and also I dont think you have explained what you want to do in great detail. So if you could explain your intended workflow and how you currently do this manually with images then it will be easier to help. 

 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
Message 6 of 10

ProRuzneDrobnosti
Contributor
Contributor

Thanks for the good advice! My question is this. How to automatically fill fields in the title block by reading data from an xls table? Find the element depicted on the drawing sheet in the xls table (first column, see screenshot) and fill in the data from the indicated column of the xls table (for example, the second column). I also add a screenshot of the drawing sheet with the title block. Thank you very much! And sorry for my English, it's terrible

0 Likes
Message 7 of 10

A.Acheson
Mentor
Mentor

Thankyou for the additional info. I don't know your specific drawing template setup but this looks similar to the forum post you worked on here.

 

If this doesn't work in your situation please provide the code attempt and you can hopefully receive help on debugging the issues. 

 

Bringing in info from excel is a good method but would it not be better to put this info to the part file via iproperty then send to the drawing automatically? No ilogic needed to populate the drawing then. This would be the most typical method where the part description drives the drawing description.  

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 8 of 10

ProRuzneDrobnosti
Contributor
Contributor

yes, this is indeed a continuation of this problem. The method proposed there worked well, but it did not provide a search in the xls table of a specific element depicted on this drawing sheet. Using iproperty is not very convenient here. I use some parameters, they are not in iproperty. But the worst thing is that the model changes dynamically during development. The parameters of the parts (for example, the name) also change (I do this work for a rather crazy, extravagant older person 😁). I already have a similar (thank you Michael.Navara) solution for a nested table. And now I am trying to find such a solution for the title block

0 Likes
Message 9 of 10

A.Acheson
Mentor
Mentor

So if I understand you correctly here are the rough workflow steps you will need. It is always important to explain this in the first post as it will help you and others understand your design intent.

  1. Get view object
  2. Get reference document
  3. Get Filename
  4. Open Excel
  5. Search column by row for filename 
  6. Use row number to return value in a different column.
  7. Use value returned to fill in titleblock.

Items 1 to 6 is covered in Michael's  supplied ilogic rule here. I would suggest to test this and get your value to be returned first into a message box. Then you can proceed to enter it into the titleblock which I believe you can allready do. Please attach your first attempt and we can guide you on your way. I'm not going to supply the code as a finished project to you because to use this level of code complexity you really need to know how to build it in order to modify in the future.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 10 of 10

ProRuzneDrobnosti
Contributor
Contributor

It's a pity. But I understand your point of view. Still, I managed to figure out a little with the codes given to me. It is enough for their minor modification (from which columns to copy, where to copy, etc.). However, writing such code on my own is far beyond my abilities. In any case, thank you for your answer

0 Likes