Document Settings update from Iproperties descriptions

Document Settings update from Iproperties descriptions

cjackson9613
Enthusiast Enthusiast
1,069 Views
7 Replies
Message 1 of 8

Document Settings update from Iproperties descriptions

cjackson9613
Enthusiast
Enthusiast

I currently have a code to update the description based of parameters input through the form within the model. I'm trying bring in this description into the IDW. I'm able to do this using the document setting>drawing>properties in drawing>copy model iproperty setting. The only way I've found to refresh the IDW description is by opening "copy model iproperty settings, unselecting "copy model iproperites" and applying then reopening and reselecting. I've looked through the forum and I may have missed it, but I was not able to find something that could help make this change automatic. Could someone help me? 

0 Likes
Accepted solutions (3)
1,070 Views
7 Replies
Replies (7)
Message 2 of 8

WCrihfield
Mentor
Mentor

So are you trying to copy iProperties from the Model file to the Drawing file, or the other way around?  I have iLogic rules for doing either one.  I also have a rule that will compare the Properties of both, and if they don't match, prompts the user about it, asking what they want to do about it.  Presenting options to Copy from Model to Drawing, Drawing to Model, or Do Nothing.  I have one that only copies all custom iproperties from Model to Drawing.  One that attempts to copy all standard iProperties from model to drawing.  One to just copy the Title & Description from the Drawing back to the Model.

Are you talking about the standard Description iProperty, that's in the Project tab?

Or is this a custom iProperty?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 8

brendon.serrano
Enthusiast
Enthusiast
Accepted solution

I believe I needed to do the same thing, so i wrote this code and had it trigger before the save of the document. 

 

Dim oControlDef As ControlDefinition  = ThisApplication.CommandManager.ControlDefinitions.Item("UpdateCopiedModeliPropertiesCmd")
oControlDef.Execute
ThisApplication.ActiveView.Fit
0 Likes
Message 4 of 8

cjackson9613
Enthusiast
Enthusiast

I'm trying to pull it from the model into the drawing. I'm able to refresh the description but it requires opening the tools>document setting>drawing>copy model iproperty settings, and unselecting applying and reselecting the "copy model iproperties" in order to fully refresh from model. If I don't do this step the old descriptions remains and doesn't refresh from the model. I found something on the forum that shows how to pull this information, but it doesn't update the iproperties within the title block.

0 Likes
Message 5 of 8

cjackson9613
Enthusiast
Enthusiast

This worked perfectly. Thank you

Message 6 of 8

WCrihfield
Mentor
Mentor
Accepted solution

Try this iLogic rule.

 

If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kDrawingDocumentObject Then
	MsgBox("This rule only works for Drawing Documents.",vbOKOnly,"WRONG DOCUMENT TYPE")
	Return
End If

Dim oMDoc As Document = ThisDrawing.ModelDocument
If oMDoc Is Nothing Then
	Return
End If

Dim oDesTracProps As PropertySet = oMDoc.PropertySets.Item("Design Tracking Properties")
Dim oModelDesc As [Property] = oDesTracProps.Item("Description")
iProperties.Value("Project", "Description") = oModelDesc.Value

InventorVb.DocumentUpdate()

 

I hope this helps.
If this solves your problem, or answers your questions, please click 'Accept As Solution".
Or, if this helps you reach your goal, please click 'LIKES" 👍.

 

Also, if you're interested, here are a few of the 'Ideas' I'd like to get implemented.
If you agree with any of them, please vote for them.

  • Add more capabilities to the 'Customize' dialog box (exe. Add Tab & Add Panel) Click Here
  • MessageBox, InputBox, and InputListBox Size & Format Options Click Here
  • Constrain & Dimension Images In Assembly Sketches & Drawing Sketches (TitleBlocks & SketchedSymbols) Click Here
  • Save Section View Status In DesignViewRepresentation (So It Can Be Used In The Drawing) Click Here
  • Add SolidBodies Folder In iLogic Rule Editor Model Tab Click Here
  • Convert All Views To Raster Before Autosave Stores To 'OldVersions' Folder Click Here
  • SetDesignViewRepresentation - Fix limitations for DrawingView of a Part Click Here
  • Create DocumentSubTypeEnum Click Here

Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 7 of 8

WCrihfield
Mentor
Mentor
Accepted solution

If all you want is to run that Update Copied Properties command, you don't need an iLogic rule.  Go to your Manage tab, Update panel.  There is already a button for this there.  You can right click on that tool, then choose "Add to Quick Access Toolbar, if you want.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 8 of 8

cjackson9613
Enthusiast
Enthusiast

This works also, but I'm actually creating a "refresh" code for my IDWs. When changes are made to the IAM all I have to do in the IDW is apply my code which updates the view scale, view label location, centers all dimensions, descriptions to match IAM (this description is coded to change when the form changes). I'm trying to minimize the amount of searching/clicking and manual changes.

0 Likes