.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Flickering Jig.

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
quigs
908 Views, 5 Replies

Flickering Jig.

Hi all,
On all my jigs that I have made, when I go past
6 lines, the 7th onwards always flickers when I
drag around the screen. Can anyone shed any
light, can you allocate more memory maybe?

Thank you.

Martin.
My name is Martin.. 😄
5 REPLIES 5
Message 2 of 6
quigs
in reply to: quigs

Why does everyone hate my jig questions? ;-(
Surley somebody out there has had a Flickery Jig. LOL
My name is Martin.. 😄
Message 3 of 6
arcticad
in reply to: quigs

Post the code that your using and a drawing example.
---------------------------



(defun botsbuildbots() (botsbuildbots))
Message 4 of 6
Anonymous
in reply to: quigs

Problems with flickering jigs always appeared in my applications when I
tried to run the code in Session mode. Running this jig code with
"CommandFlags.Modal" was the solution for me.


schreef in bericht news:6340454@discussion.autodesk.com...
Hi all,
On all my jigs that I have made, when I go past
6 lines, the 7th onwards always flickers when I
drag around the screen. Can anyone shed any
light, can you allocate more memory maybe?

Thank you.

Martin.
Message 5 of 6
quigs
in reply to: quigs

Hi there,
Someone asked me to post an example of my
code for my "flickery jig".

Well here it is. I have used a very small jig to
create a slope for a fall line, and added lots of
"RUBBISH lines that twirl around the start point".
This is to show that the last few in the jig flicker
When you drag around in the command. If anyone
could shed some light on why this may be
happening that would be fab.

Thanks in advance,

Martin.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Geometry
Imports Autodesk.AutoCAD

Public Class Slope
Inherits DrawJig

Dim StPnt As Point3d ' Center - Start
Dim EndPt As New Point3d ' Center - End
Dim EndPtH As Point3d
Dim LineDrg As New Line ' Center = Line

Dim myPR As PromptPointResult
Function StartJig() As PromptPointResult
Dim doc As Document = Application.DocumentManager.MdiActiveDocument
Dim db As Database = doc.Database
Dim ed As Editor = doc.Editor
Dim ppr1 As PromptPointResult = ed.GetPoint(vbLf & "Specify Start: ")
StPnt = ppr1.Value
LineDrg.StartPoint = StPnt
' LineDrg.ColorIndex = 2

ppr1 = ed.Drag(Me)
Do
Select Case ppr1.Status
Case PromptStatus.OK
Return ppr1
Exit Do
End Select
Loop While ppr1.Status <> PromptStatus.Cancel
Return ppr1
End Function
Protected Overrides Function Sampler(ByVal prompts As JigPrompts) As SamplerStatus
myPR = prompts.AcquirePoint("Select End point:")
If myPR.Value.IsEqualTo(EndPt) Then
Return SamplerStatus.NoChange
Else
EndPt = myPR.Value
LineDrg.EndPoint = EndPt
Return SamplerStatus.OK
End If
End Function

Protected Overrides Function WorldDraw(ByVal draw As GraphicsInterface.WorldDraw) As Boolean

''''''''''''''''''''''' DRAG LINE ''''''''''''''''''''''''
Dim DrLnRst As New Line ' Drag Line
DrLnRst.StartPoint = StPnt
DrLnRst.EndPoint = EndPt
DrLnRst.ColorIndex = 4 ' Cyan
draw.Geometry.Draw(DrLnRst)
Dim SLAng As Double
SLAng = DrLnRst.Angle
''''''''''''''''''''' DRAG LINE END ''''''''''''''''''''''

''''''''''''''''''''' HORIZONTAL LINE ''''''''''''''''''''
EndPtH = New Point3d(EndPt.X, StPnt.Y, 0)
Dim HorzL As New Line
HorzL.StartPoint = StPnt
HorzL.EndPoint = EndPtH
HorzL.ColorIndex = 4
draw.Geometry.Draw(HorzL)
Dim HLLen As Double
HLLen = HorzL.Length
''''''''''''''''''' HORIZONTAL LINE END ''''''''''''''''''

'''''''''''''''''''''' VERTICAL LINE '''''''''''''''''''''
Dim VertL As New Line
VertL.StartPoint = EndPt
VertL.EndPoint = EndPtH
VertL.ColorIndex = 1
draw.Geometry.Draw(VertL)
Dim VLLen As Double
VLLen = VertL.Length
'''''''''''''''''''' VERTICAL LINE END '''''''''''''''''''

'''''''''''''''''''' show flicker '''''''''''''''''''''''
Dim A1 As Double = (20 / (180 / Math.PI)) + SLAng
Dim A2 As Double = (50 / (180 / Math.PI)) + SLAng
Dim A3 As Double = (120 / (180 / Math.PI)) + SLAng
Dim A4 As Double = (160 / (180 / Math.PI)) + SLAng
Dim A5 As Double = (200 / (180 / Math.PI)) + SLAng
Dim A6 As Double = (240 / (180 / Math.PI)) + SLAng
Dim A7 As Double = (260 / (180 / Math.PI)) + SLAng
Dim A8 As Double = (270 / (180 / Math.PI)) + SLAng
Dim A9 As Double = (280 / (180 / Math.PI)) + SLAng
Dim A10 As Double = (290 / (180 / Math.PI)) + SLAng
Dim tmp1 = StPnt.Add(New Vector3d(Math.Cos(A1) * 10, Math.Sin(A1) * 10, 0))
Dim tmp2 = StPnt.Add(New Vector3d(Math.Cos(A2) * 10, Math.Sin(A2) * 10, 0))
Dim tmp3 = StPnt.Add(New Vector3d(Math.Cos(A3) * 10, Math.Sin(A3) * 10, 0))
Dim tmp4 = StPnt.Add(New Vector3d(Math.Cos(A4) * 10, Math.Sin(A4) * 10, 0))
Dim tmp5 = StPnt.Add(New Vector3d(Math.Cos(A5) * 10, Math.Sin(A5) * 10, 0))
Dim tmp6 = StPnt.Add(New Vector3d(Math.Cos(A6) * 10, Math.Sin(A6) * 10, 0))
Dim tmp7 = StPnt.Add(New Vector3d(Math.Cos(A7) * 10, Math.Sin(A7) * 10, 0))
Dim tmp8 = StPnt.Add(New Vector3d(Math.Cos(A8) * 10, Math.Sin(A8) * 10, 0))
Dim tmp9 = StPnt.Add(New Vector3d(Math.Cos(A9) * 10, Math.Sin(A9) * 10, 0))
Dim tmp10 = StPnt.Add(New Vector3d(Math.Cos(A10) * 10, Math.Sin(A10) * 10, 0))
draw.Geometry.Draw(New Line(StPnt, tmp1))
draw.Geometry.Draw(New Line(StPnt, tmp2))
draw.Geometry.Draw(New Line(StPnt, tmp3))
draw.Geometry.Draw(New Line(StPnt, tmp4))
draw.Geometry.Draw(New Line(StPnt, tmp5))
draw.Geometry.Draw(New Line(StPnt, tmp6))
draw.Geometry.Draw(New Line(StPnt, tmp7))
draw.Geometry.Draw(New Line(StPnt, tmp8))
draw.Geometry.Draw(New Line(StPnt, tmp9))
draw.Geometry.Draw(New Line(StPnt, tmp10))
End Function

_
Public Sub DoJigA()
'Get the active document and begin a Transaction
Dim myDWG As Document = Application.DocumentManager.MdiActiveDocument

Using myTransMan As DatabaseServices.TransactionManager = myDWG.TransactionManager
Dim myTrans As Transaction = myTransMan.StartTransaction
'Open the BlockTable for Read
Dim myEd As Editor = myDWG.Editor
Dim myBT As BlockTable = myDWG.Database.BlockTableId.GetObject(DatabaseServices.OpenMode.ForRead)
Dim myBTR As BlockTableRecord = myBT(DatabaseServices.BlockTableRecord.ModelSpace).GetObject(DatabaseServices.OpenMode.ForWrite)
' Start Jig
Dim myJig As New Slope
Dim SelPt As Autodesk.AutoCAD.EditorInput.PromptPointResult
SelPt = myJig.StartJig()
' Points
Dim StPnt As Point3d = myJig.StPnt
Dim EndPt As Point3d = myJig.EndPt
Dim EndPtH As Point3d = myJig.EndPtH
Dim PtCol As New Point3dCollection
PtCol.Add(StPnt)
PtCol.Add(EndPt)
PtCol.Add(EndPtH)
Dim Pl As New Polyline2d(Poly2dType.SimplePoly, PtCol, 0, True, 0, 0, Nothing)
Pl.ColorIndex = 4 '1=Red 2=Yellow 3=Green 4=Cyan 5=Blue 6=Purple 7=White
Pl.Closed = True


myBTR.AppendEntity(Pl)
myTrans.AddNewlyCreatedDBObject(Pl, True)
Pl.Dispose()
myTrans.Commit()
myTrans.Dispose()
myTransMan.Dispose()
End Using
End Sub
End Class
My name is Martin.. 😄
Message 6 of 6
quigs
in reply to: quigs

Hi,

if you increase these values, then the jig stops flickering:

 

Application.SetSystemVariable("dragp1", 2000)

Application.SetSystemVariable("dragp2", 2000)

 

Cheers again!  😄

 

 

Martin.

My name is Martin.. 😄

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost