Hello everyone,
I created a dimension with ilogic. However, the dimension always appears centered, regardless of whether the arrows are inwards or outwards. How do I move a dimension to a position outside the arrow with ilogic?
I attach two images: one with the dimension centered and how the program creates it and the other with the dimension as I would like it to be created.
Thank you to anyone who can take the time to help.
Dim cotaCcomprimento_SF = genDims_SF.AddLinear("cotaCcomprimento_SF", VIEW01_SF.SheetPoint(DistCotaComprY + .1, + DistCotaComprX), diam1_SF, profcsliso_SF, DimensionTypeEnum.kVerticalDimensionType,) cotaCcomprimento_SF.NativeEntity.TolerancePrecision = 2 cotaCcomprimento_SF.NativeEntity.Tolerance.SetToDeviation(+0.00, -0.03 * .1)
Solved! Go to Solution.
Solved by m_baczewski. Go to Solution.
Solved by Michael.Navara. Go to Solution.
You can use something like this
Dim drwDim As Inventor.LinearGeneralDimension = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingDimensionFilter, "Pick dim")
Dim txtOrigin = drwDim.Text.Origin
txtOrigin.TranslateBy(drwDim.DimensionLine.Direction.AsVector())
drwDim.Text.Origin = txtOrigin
Thanks for the answer. It works, but it's not exactly what I need, as it will always require me to do manual editing, and if there are several quotas with the same problem, I will always need to check them one by one.
But I will save the code as it may be useful to me.
Thanks!
To start, you need to:
Dim oDoc As DrawingDocument oDoc = ThisApplication.ActiveDocument Dim oTG As TransientGeometry = ThisApplication.TransientGeometry Dim oDimensions As drawingDimensions oDimensions = oDoc.ActiveSheet.DrawingDimensions Dim oDimension1 As LinearGeneralDimension oDimension1 = oDimensions.Item(19) Dim poczatkowePolozenieWymiaru1 As Point2d poczatkowePolozenieWymiaru1 = oDimension1.Text.Origin Dim nowePolozenieWymiaru1 As Point2d nowePolozenieWymiaru1 = oTG.CreatePoint2d(poczatkowePolozenieWymiaru1.X - 1, poczatkowePolozenieWymiaru1.Y - 0.35) oDimension1.Text.Origin = nowePolozenieWymiaru1
This is the method I've come up with, but there may be a better and faster way to solve this problem.
Thank you all. The comments were very useful and I was able to extract information to get the final result I wanted.
Below I leave the final code in which I obtained the result.
The last line of the schedule is what I needed.
Thanks
Dim cotaCcomprimento_SF = genDims_SF.AddLinear("cotaCcomprimento_SF", VIEW01_SF.SheetPoint(DistCotaComprY + .1, + DistCotaComprX), diam1_SF, profcsliso_SF, DimensionTypeEnum.kVerticalDimensionType,) cotaCcomprimento_SF.NativeEntity.TolerancePrecision = 2 cotaCcomprimento_SF.NativeEntity.Tolerance.SetToDeviation(+ 0.00, -0.03 * .1) cotaCcomprimento_SF.NativeEntity.Text.Origin = ThisApplication.TransientGeometry.CreatePoint2d(cotaCcomprimento_SF.NativeEntity.Text.Origin.X, cotaCcomprimento_SF.NativeEntity.Text.Origin.Y+1)
Can't find what you're looking for? Ask the community or share your knowledge.