Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello
I wrote some code (with your help) that draws 3D circles when given the center point of the circle and the direction perpendicular to the plane of the circle. I now want to create points along the circle. This is it so far:
rstObj.MoveFirst For i& = 1 To rstObj.RecordCount y# = rstObj!cly x# = rstObj!clx z# = rstObj!clz nn# = rstObj!clDirection cc# = rstObj!clchain ' Define the UCS points origin(0) = y#: origin(1) = x#: origin(2) = z# + al(TextBoxElevationOffset) xAxisPnt(0) = origin(0) + Sin(nn# + Pi# / 2) * 100: xAxisPnt(1) = origin(1) + Cos(nn# + Pi# / 2) * 100: xAxisPnt(2) = z# + hc# yAxisPnt(0) = origin(0): yAxisPnt(1) = origin(1): yAxisPnt(2) = 100 ' Add the UCS to the UserCoordinatesSystems collection Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPnt, yAxisPnt, "New_UCS") ' Display the UCS icon ThisDrawing.ActiveViewport.UCSIconAtOrigin = True ThisDrawing.ActiveViewport.UCSIconOn = True ' Make the new UCS the active UCS ThisDrawing.ActiveUCS = ucsObj 'Draw the ring with the chainage text Set circObj = ThisDrawing.ModelSpace.AddCircle(origin, rr#) Set txtObj = ThisDrawing.ModelSpace.AddText(Format(cc#, "######0.00"), origin, 0.2) 'here is my code that doesn't work '01 14 2018 'create points on the ring ang# = 0: dang# = 15 * Pi# / 180 For jj% = 1 To 24 yp# = origin(0) + Sin(ang#) * rr#: xp# = origin(1) + Cos(ang#) * rr#: zp# = origin(2) + Sin(ang#) * rr# 'insertionPnt(0) = yp# 'insertionPnt(1) = xp# 'insertionPnt(2) = zp# 'Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(insertionPnt, "pt250", 1#, 1#, 1#, 0) ' ' Get the attributes for the block reference ' varAttributes = blockRefObj.GetAttributes ' 'blockrefobject. ' varAttributes(0).TextString = Format(cc#, "#####0.00") ' varAttributes(1).TextString = Format(zp#, "#####0.000") ang# = ang# + dang# Next jj% 'end addition rstObj.MoveNext Next i&
Any help will be gratefully appreciated
John
Solved! Go to Solution.