Author Topic: Custom sized MvPart?  (Read 2284 times)

0 Members and 1 Guest are viewing this topic.

MexicanCustard

  • Swamp Rat
  • Posts: 705
Custom sized MvPart?
« on: April 24, 2011, 12:24:39 PM »
How do I add MultiViewParts with custom sizes? I've got a MvPart which is just a cylinder. I have a Diameter and a Height parameter defined in my part as list parameters. It's also flagged for custom sizes.

When using:

DataExpandedTable exTbl = PartManager.GetPartTable(query, 10);
DataRecord newRec = exTbl.DataRecords[0];
newRec.DataFields.FindByContextAndIndex(Context.GeometryModelParameter, 1).ValueDouble = 10; //change Diameter

MultiViewPart mvPart = new MultiViewPart();
mvPart.SetDatabaseDefaults(currDB);
MvPart.SetToStandard(currDB);

PartManager.CreatePartViaRecord(exTbl, newRec, mvPart);
 

Autocad ignores any changes I make to the DataRecord newRec before calling CreatePartViaRecord and inserts the cylinder with the default sizes. I don't want to add additional sizes to the Catalog if I can avoid it. I just want to define custom sizes while adding the cylinder to the database. I can do this manually within the drawing so I'm assuming it can be done via code.
Revit 2019, AMEP 2019 64bit Win 10

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Custom sized MvPart?
« Reply #1 on: April 25, 2011, 06:47:14 AM »
Can you load up a drawing with the part?

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Custom sized MvPart?
« Reply #2 on: April 25, 2011, 04:58:35 PM »
Here's a .dwg with the cylinder inserted as default size 6x4.
Revit 2019, AMEP 2019 64bit Win 10

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Custom sized MvPart?
« Reply #3 on: April 28, 2011, 04:59:28 PM »
BUMP
Revit 2019, AMEP 2019 64bit Win 10

Jeff H

  • Needs a day job
  • Posts: 6144
Re: Custom sized MvPart?
« Reply #4 on: May 03, 2011, 05:22:41 PM »
Have you looked at the AddModifyPart sample?

MexicanCustard

  • Swamp Rat
  • Posts: 705
Re: Custom sized MvPart?
« Reply #5 on: May 06, 2011, 07:47:22 AM »
Yes, it's what got me to this point but it only looks up and inserts an existing part size.
Revit 2019, AMEP 2019 64bit Win 10