How Can I Edit Revision Table Through iLogic & a Form?

How Can I Edit Revision Table Through iLogic & a Form?

Anonymous
Not applicable
3,665 Views
6 Replies
Message 1 of 7

How Can I Edit Revision Table Through iLogic & a Form?

Anonymous
Not applicable

Hello Everyone,

 

I'm fairly new to iLogic and APIs.  The most impressive thing I can do is adjust patterns and suppress components in an assembly based off of information in a Multi-Body.  Right now, I'm looking to do something a few levels up from that.  If you can help me or, better yet, help me help myself, I would be most appreciative and will buy you a beer if I can convince my superiors to send me to Autodesk University.

 

I'm looking to create a form that pops up when a drawing is opened.  I'd like the form to allow you to add a new revison row, enter a description, set the date and the author's initials (it would be great if those last two options are automatic but, I'm not too picky right now.)

 

Thanks for readings and I hope you can help.

0 Likes
Accepted solutions (1)
3,666 Views
6 Replies
Replies (6)
Message 2 of 7

j.romo
Advocate
Advocate
Accepted solution

I use a form where I put Iproperty "Revision Number", create a custom Iprop called Today as date = checkmark date

Iproperty "Status", "Mfg. Approved By" and  Iproperty "Status" Mfg. Approved By:"

DATA REV.JPGThen i use the next code to add a new row

SyntaxEditor Code Snippet

Try
' Get the current revision table, must be created (Thanks to Curtis)
	Dim oRevTable As RevisionTable
	oRevTable = ThisDoc.Document.ActiveSheet.RevisionTables.Item(1)
	'add a new rev row
	Dim oRows As RevisionTableRows 
	oRevRowCount = oRevTable.RevisionTableRows.Count		
	Dim oRow As RevisionTableRow
	oRows = oRevTable.RevisionTableRows
	oRows.Add()
	iProperties.Value("Custom", "Date") = Now

Catch
	MessageBox.Show("Tabla de revision No hallada.", "REVISION")
End Try

iLogicVb.UpdateWhenDone = True 

and finally create a form FORM.JPG

Finally If you really want to open the form each time the drawing is open the form pops up use event triggers

and use a rule to open the form with something like this in another rule called what ever you want

 

SyntaxEditor Code Snippet

iLogicForm.Show("Your Form Name Here")

 event.JPG

and you will have somethin functional.

Jorge Romo

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thank you for your help with this.  I learned a lot.  The only thing that is hanging me up right now is how to link the Revision Table's cell to the Custom iProperities info I created.  I'm looking through the API Helper and there are a lot of options but, nothing I try seems to work.  Any suggestions?

 

Thanks again

0 Likes
Message 4 of 7

j.romo
Advocate
Advocate

Can you elaborate a little more?

The way it works is you put the Iprops and fill them in the Rev Table If you want to collect old revision information we use External Excel sheets to collect the data.

0 Likes
Message 5 of 7

Anonymous
Not applicable
Absolutely.  So far, I have everything working except for updating the "description" field.  I am thinking that this might be driven from somewhere else and I just need to find out where.

Below is what I have done as well as a our Rev Table

Rev-Table.PNG
Try
' Get the current revision table, must be created (Thanks to Curtis)

    Dim oRevTable As RevisionTable
    oRevTable = ThisDoc.Document.ActiveSheet.RevisionTables.Item(1)
    'add a new rev row
    Dim oRows As RevisionTableRows
    oRevRowCount = oRevTable.RevisionTableRows.Count       
    Dim oRow As RevisionTableRow
    oRows = oRevTable.RevisionTableRows
    oRows.Add()
    iProperties.Value("Custom", "Date") = Now
    iProperties.Value("Custom", "ECR") = REV_ECR
   
   
Catch
    MessageBox.Show("Tabla de revision No hallada.", "REVISION")
End Try
iLogicVb.UpdateWhenDone = True

 

0 Likes
Message 6 of 7

j.romo
Advocate
Advocate

OK.JPG

Add these buttons to update and insert the fields co Iproperties in your form.

 

0 Likes
Message 7 of 7

Anonymous
Not applicable

Thank you for your help with this.  I think I understand where my problem is.  The description in our title block is not driven from iProperites.  I will try and get this changed so that we can link everything like you have.

 

Again, I appreciate your help.

0 Likes