iLogic - creating dimensions on section views

iLogic - creating dimensions on section views

Anonymous
Not applicable
1,158 Views
4 Replies
Message 1 of 5

iLogic - creating dimensions on section views

Anonymous
Not applicable

Hi,

 

I have a section view of a cylinder with 2 grooves (see figure below). I have managed to create dims a,b,c,d thru ilogic code (see code below). I also want to create the radius of each groove and the radius of the cylinder (r1, r2 and r3 in the figure), but I cant get it to work. I've tried identifying points on the drawing curve of each face, and then draw the dimension line from those, but I get error message. Please help me sort this out!

 

Another thing is that I don't have control of which side dims a,b,c,d appear on. How can I control whether the dimensions appear on the left side or the right side of the cylinder?

 

'Finds faces with attributes
	aoAttributeSets = oAssyDoc.AttributeManager.FindAttributeSets("SectionViewA","Face*",sOeString)
	iAttributeSetsCounter = aoAttributeSets.Count
	
	Dim aoFacesSectionViewA(0 To iAttributeSetsCounter) As Face

	For i=1 To iAttributeSetsCounter
		oObjs = oAssyDoc.AttributeManager.FindObjects(
			"SectionViewA",
			"Face" & i,
			sOeString)
		aoFacesSectionViewA(i) = oObjs(1)
	Next
	
	'Finds the equivalent drawing curves on the section view
	Dim aoDrawCurvesSectionViewA(0 To iAttributeSetsCounter) As DrawingCurve
	For i = 1 To iAttributeSetsCounter
		oDrawViewCurves = oSectionViewA.DrawingCurves(aoFacesSectionViewA(i))
		aoDrawCurvesSectionViewA(i) = oDrawViewCurves.Item(1)
	Next
	
	'Draws dimensions
	
	'Bearing groove width
	oPtDim = oTG.CreatePoint2d(,oSectionViewA.Top + iDim_Space)
	oDim = oGeneralDims.AddLinear(
		oPtDim,
		oSheet.CreateGeometryIntent(aoDrawCurvesSectionViewA(2))) 
	
	'Seal groove width
	oPtDim = oTG.CreatePoint2d(,oSectionViewA.Top + iDim_Space)
	oDim = oGeneralDims.AddLinear(
		oPtDim,
		oSheet.CreateGeometryIntent(aoDrawCurvesSectionViewA(3))) 
	
	'Seal groove height
	oPtDim = oTG.CreatePoint2d(oSectionViewA.Left + oSectionViewA.Width + 2*iDim_Space,)
	oDim = oGeneralDims.AddLinear(
		oPtDim,
		oSheet.CreateGeometryIntent(aoDrawCurvesSectionViewA(4))) 
	
	'Bearing groove height
	oPtDim = oTG.CreatePoint2d(oSectionViewA.Left + oSectionViewA.Width + iDim_Space,)
	oDim = oGeneralDims.AddLinear(
		oPtDim,
		oSheet.CreateGeometryIntent(aoDrawCurvesSectionViewA(5))) 

 

2016-11-24_09-32-48.png

0 Likes
1,159 Views
4 Replies
Replies (4)
Message 2 of 5

rikard.nilsson
Collaborator
Collaborator

Hi,

 

Here is a quick tip for you..

When placing dimensions.. Place them on Work Points and not on geometries,.

Then you have a lot more control over placement..

 

I think that will solve both your problem..

 

/Rikard

 

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi, thank you for your help on this and my other posts as well. It has helped me alot.

 

I started looking into work points and came over this pdf file:

 

https://forums.autodesk.com/autodesk/attachments/autodesk/120/58687/1/MA316-5,ConfiguratorTips.pdf

 

So this got me thinking what might be the best method for my assembly.. I was thinking of using a combination of the  "retrieving dimensions from the model" on page 23, and dimension to named work points on page 25.

My model is built up like this:

 

Layout sketch (skeletal modeling) ----> create new part and derive sketch from the skeletal model, create solid and create details ------> create new part using the "mark part" function in the layout tab -------> put part into assembly and create drawing of that assemly (it is a company policy to make drawings out of assemblies and not parts even tho the assembly just contains a single part).

 

My questions are:

 

1. I was thinking to create a new sketch in my assembly and create driven dimensions of the part (e.g. outer and inner diameter, height etc). I would then assign attributes to each driven dimension so I can search for it when creating the drawing. The driven dimensions would be constrained to projected geometry of the layout sketch, so it would be updated if the part updates. Is this even possible? I tried with the below code, but it did not work as intented. What happened was that it created a lot of dimensions, and not just of the single dimension i defined in "dimsToRetrieve".

Dim dimsToRetrieve As ObjectCollection
dimsToRetrieve = oAssyDoc.AttributeManager.FindObjects("DIM","OD","1")
oSheet.DrawingDimensions.GeneralDimensions.Retrieve(oMainView,dimsToRetrieve)

2. A follow up question to number 1. If it is possible to retrieve dimensions like this. Is there a way I can retrieve this dimension directly from the skeleton sketch (e.g. height and diameters) without having to create proxies in the assembly?

 

 

 

0 Likes
Message 4 of 5

Anonymous
Not applicable

I created a part to show how my assembly is built up. The drawing contains code that creates a set of views. I would like to figure out how to create dimensions in my drawing based on the model dimensions. I got work points figured out = ) You will need to put the correct path to the assembly in the drawing rule for it to work.

0 Likes
Message 5 of 5

rikard.nilsson
Collaborator
Collaborator

Hi,

 

Take a look at this solution..I think it will help you with this..

 

http://forums.autodesk.com/t5/inventor-customization/retrieve-dimensions/m-p/3650292/highlight/true#...

 

/Rikard

0 Likes