Click here to Skip to main content
15,914,767 members
Home / Discussions / C#
   

C#

 
AnswerRe: Only show decimals if there are any Pin
Wayne Gaylard14-Jul-11 22:32
professionalWayne Gaylard14-Jul-11 22:32 
SuggestionRe: Only show decimals if there are any Pin
GuyThiebaut14-Jul-11 22:55
professionalGuyThiebaut14-Jul-11 22:55 
GeneralRe: Only show decimals if there are any Pin
Wayne Gaylard14-Jul-11 23:23
professionalWayne Gaylard14-Jul-11 23:23 
GeneralRe: Only show decimals if there are any Pin
Blue_Boy14-Jul-11 23:50
Blue_Boy14-Jul-11 23:50 
GeneralRe: Only show decimals if there are any Pin
Etienne_12315-Jul-11 2:56
Etienne_12315-Jul-11 2:56 
AnswerRe: Only show decimals if there are any Pin
PIEBALDconsult15-Jul-11 2:55
mvePIEBALDconsult15-Jul-11 2:55 
AnswerRe: Only show decimals if there are any Pin
DaveyM6917-Jul-11 5:52
professionalDaveyM6917-Jul-11 5:52 
Questionchemsketch Pin
albertodiprima14-Jul-11 1:55
albertodiprima14-Jul-11 1:55 
i'm developing a chemistry program i find this code in the program chemsketch
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' ACD CHEMBASIC DEMO PROGRAM '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' '
' Molecular 3D Editor//MIRROR.BAS '
' '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' '
' The utility flips the molecule at a plane '
' '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''


CONST TITLE="ChemBasic Molecular Editor // Mirror"


'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Function Main As String
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' MIRROR.BAS '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim page,diag,asm,struc As Object, s As String, OK As Boolean

MAIN="Failed or nothing to do!"

' Get 1st structure from the curent page
page=ActiveDocument.ActivePage
If page.Diagrams.Count<1 Then Exit Function
diag=page.Diagrams.Item(1)
asm=Assemblies.AddFromCS(diag)
If asm=NULL Then Exit Function
struc=Asm.Structures.Item(1)
If struc=NULL Then Exit Function

' Do the job
s=UserIOBox("Flip X, Y, or Z coordinate ?" ,TITLE , "Y")
s=UCase(Left(s,1))
If s="X" OR s="Y" OR s="Z" Then
' Flip !
Call Flip(struc,s)
' Show the results
RefreshDiagram(diag,struc)
Main="Completed."
End If

End Function



'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Flip(struc As Object,s As String)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim x,y,z As Double, asm,at As Object
With struc
asm=.Assembly
For Each at In asm
.GetAtomXYZ(at,x,y,z)
Select Case s
Case "X"
x=-x
Case "Y"
y=-y
Case "Z"
z=-z
End Select
.SetAtomXYZ(at,x,y,z)
Next at
End With
End Sub


'***LIBRARY PROCEDURES BEGIN



'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub RefreshDiagram(diag As Object,strmol As Object)
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' LIB0.BAS PROCEDURE '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Redraws the diagram with a molecule or structure object '
' '
' ENTER '
' diag object of type CS_DIAGRAM '
' strmol object of type CB_MOLECULE or CB_STRUCTURE '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim l,t,w,h,w1,h1 As Integer
diag.GetBound(l,t,w,h)
diag.Depict(strmol)
diag.GetBound(w,h,w1,h1)
diag.SetBound(l,t,w1,h1)
End Sub



'***LIBRARY PROCEDURES END

'@@@@@@
AnswerRe: chemsketch PinPopular
Richard MacCutchan14-Jul-11 1:56
mveRichard MacCutchan14-Jul-11 1:56 
GeneralRe: chemsketch Pin
albertodiprima14-Jul-11 2:08
albertodiprima14-Jul-11 2:08 
GeneralRe: chemsketch Pin
Keith Barrow14-Jul-11 3:06
professionalKeith Barrow14-Jul-11 3:06 
GeneralRe: chemsketch Pin
Richard MacCutchan14-Jul-11 4:23
mveRichard MacCutchan14-Jul-11 4:23 
GeneralRe: chemsketch Pin
BobJanova14-Jul-11 4:27
BobJanova14-Jul-11 4:27 
GeneralRe: chemsketch PinPopular
Richard MacCutchan14-Jul-11 4:30
mveRichard MacCutchan14-Jul-11 4:30 
GeneralRe: chemsketch Pin
BobJanova14-Jul-11 5:09
BobJanova14-Jul-11 5:09 
QuestionSearching XML file Pin
NarVish13-Jul-11 23:26
NarVish13-Jul-11 23:26 
AnswerRe: Searching XML file Pin
Mirko198014-Jul-11 1:17
Mirko198014-Jul-11 1:17 
GeneralRe: Searching XML file Pin
NarVish14-Jul-11 2:22
NarVish14-Jul-11 2:22 
AnswerRe: Searching XML file Pin
Not Active14-Jul-11 1:59
mentorNot Active14-Jul-11 1:59 
QuestionAdding a hyperlink to a sentence of text in a bulleted list Pin
Wheels01213-Jul-11 8:31
Wheels01213-Jul-11 8:31 
AnswerRe: Adding a hyperlink to a sentence of text in a bulleted list Pin
Shameel13-Jul-11 21:53
professionalShameel13-Jul-11 21:53 
GeneralRe: Adding a hyperlink to a sentence of text in a bulleted list Pin
Wheels01214-Jul-11 1:28
Wheels01214-Jul-11 1:28 
GeneralRe: Adding a hyperlink to a sentence of text in a bulleted list Pin
BobJanova14-Jul-11 2:04
BobJanova14-Jul-11 2:04 
GeneralRe: Adding a hyperlink to a sentence of text in a bulleted list Pin
Wheels01214-Jul-11 2:06
Wheels01214-Jul-11 2:06 
GeneralRe: Adding a hyperlink to a sentence of text in a bulleted list Pin
Shameel14-Jul-11 2:16
professionalShameel14-Jul-11 2:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.