Dear Sir,
I got the solution to place component based on mouse click, based on the above code by xiaodong.liang
Sub Main()
Dim oInteraction As InteractionEvents
oInteraction = ThisApplication.CommandManager.CreateInteractionEvents
Dim oMouse As MouseEvents
oMouse = oInteraction.MouseEvents
AddHandler oMouse.OnMouseDown ,AddressOf oMouse_OnMouseDown
oInteraction.Start
End Sub
Sub oMouse_OnMouseDown(Button As MouseButtonEnum, ShiftKeys As ShiftStateEnum, ModelPosition As Point, ViewPosition As Point2d, view As View)
'MsgBox (Button)
Posx=ModelPosition.X
Posy=ModelPosition.Y
Posz=ModelPosition.Z
' Create a matrix.
Dim oMatrix As Matrix
Dim oTG As TransientGeometry
oTG = ThisApplication.TransientGeometry
oMatrix = oTG.CreateMatrix
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oOccurrence As ComponentOccurrence
oFile = "X:\Pipe Clamp & Liner Assembly - Manual.iam"
oMatrix.SetTranslation(oTG.CreateVector(Posx, Posy, Posz))
oOccurrence = oAsmCompDef.Occurrences.Add(oFile, oMatrix)
End Sub