TheSwamp

Code Red => VB(A) => Topic started by: Matersammichman on December 08, 2006, 03:23:25 PM

Title: Update Last Dimension
Post by: Matersammichman on December 08, 2006, 03:23:25 PM
DimUpdate doesn't exist in vba, and I can't get SendCommand to release, so how do I Update a dimension?
Title: Re: Update Last Dimension
Post by: ska67can on December 08, 2006, 03:42:56 PM
Lets see your code.
Title: Re: Update Last Dimension
Post by: David Hall on December 08, 2006, 03:45:58 PM
my guess w/o seeing your code would be to store the style name and select dims and re-assign them the style name forcing an update
Title: Re: Update Last Dimension
Post by: Matersammichman on December 08, 2006, 03:46:17 PM
ThisDrawing.SendCommand "dim" & vbCr & "up" & vbCr & "l" '& vbCr '
Title: Re: Update Last Dimension
Post by: Atook on December 08, 2006, 03:56:43 PM

Code: [Select]
Dim objdim As AcadDimension
    objdim.Update

does .update not work?
Title: Re: Update Last Dimension
Post by: Matersammichman on December 08, 2006, 04:19:41 PM
No.
Title: Re: Update Last Dimension
Post by: Cathy on December 08, 2006, 04:55:37 PM
Do you need to update because you've changed the dimstyle?
Quote
Dimensions created via the AutoCAD user interface are created with the active dimension style plus all document overrides. Dimensions created via ActiveX are created with the active dimension style only. To have the dimensions created via ActiveX take on the document overrides, use the CopyFrom method to copy the dimension style from the document to the active dimension style. This process will copy all existing overrides into the active dimension style.

Code: [Select]
.....
     ThisDrawing.SetVariable "LUNITS", 2
     ThisDrawing.SetVariable "LUPREC", 2
     ThisDrawing.SetVariable "DIMLUNIT", 2
     ThisDrawing.SetVariable "DIMDEC", 2

    objDimStyle.CopyFrom ThisDrawing
    ThisDrawing.ActiveDimStyle = objDimStyle
Title: Re: Update Last Dimension
Post by: Matersammichman on December 08, 2006, 05:26:05 PM
Yes. I changed the parameters within the Dimstyle
Title: Re: Update Last Dimension
Post by: Cathy on December 09, 2006, 12:03:27 PM
and did you copy the changes to the activedimstyle as above?
Title: Re: Update Last Dimension
Post by: ska67can on December 09, 2006, 10:54:27 PM
I meant all you code
Title: Re: Update Last Dimension
Post by: Matersammichman on December 11, 2006, 07:43:19 AM
Thanks Cathy. Your suggestion worked.