the VB program generates bigger shapes than usual

the VB program generates bigger shapes than usual

Anonymous
Not applicable
353 Views
1 Reply
Message 1 of 2

the VB program generates bigger shapes than usual

Anonymous
Not applicable

Hi to everyone,

 

I am a beginner with VB.net and Autocad,

 

I have been giver a program by a partner in VB.net to generate drawing in Autocad,

 

In his computer, everything is working fine,

 

When I tried to run the same program on mine it gives me a wrong display ;

 

The part listed in the code below appears 50 times bigger than the other items of my drawing :

 

Here is a part of the code :

 

Sub MainPanelIBIU1List()
Dim FuctionXPos As String = "0.5767", YPos1st As Double = 15.3596, BIUFont As String = "0.08" 
Dim ToXPos As String = "1.641"
Dim BIU1Listing(,) = {{"+24 VDC", "K1-11"}, {"+24 VDC", "J2-1B"},
{"LS1 RED", "LS1-6"}, {"LS1 YELLOW", "LS1-8"}, {"LS1 GREEN", "LS1-10"}, {"LS2 RED", "LS2-6"}, {"LS2 YELLOW", "LS2-8"}, {"LS2 GREEN", "LS2-10"},
{"LS3 RED", "LS3-6"}, {"LS3 YELLOW", "LS3-8"}, {"LS3 GREEN", "LS3-10"}, {"LS4 RED", "LS4-6"}, {"LS4 YELLOW", "LS4-8"}, {"LS4 GREEN", "LS4-10"},
{"LS5 RED", "LS5-6"}, {"LS5 YELLOW", "LS5-8"}, {"LS5 GREEN", "LS5-10"}, {"LS6 RED", "LS6-6"}, {"LS6 YELLOW", "LS6-8"}, {"LS6 GREEN", "LS6-10"},
{"LS7 RED", "LS7-6"}, {"LS7 YELLOW", "LS7-8"}, {"LS7 GREEN", "LS7-10"}, {"LS8 RED", "LS8-6"}, {"LS8 YELLOW", "LS8-8"}, {"LS8 GREEN", "LS8-10"},
{"TBC AUX 1", "A-16"}, {"TBC AUX 2", "A-17"}, {"PMT ACT 1", "A-21"}, {"PMT ACT 2", "A-22"}, {"PMT CALL 1", "B-15"}, {"PMT CALL 2", "B-16"},
{"TEST A", "A-12"}, {"TEST B", "A-13"}, {"AUTO FLASH", "A-37"}, {"DIM. ENABLE", "A-36"}, {"MANUAL CONT.", "A-39"}, {"INT. ADVANCE", "A-40"},
{"EXT. MIN. RECALL", "A-10"}, {"EXT. START", "A-11"}, {"TBC ONLINE", "A-15"}, {"STOP TIME (1)", "A-30"}, {"STOP TIME (2)", "A-30"}, {"MAX. 2 (1)", "A-5"}, {"MAX. 2 (2)", "A-6"},
{"FORCE OFF (1)", "A-3"}, {"FORCE OFF (2)", "A-4"}, {"CNA 1", "A-7"}, {"WALK REST MOD.", "A-9"}, {"PED. ISO. 1", "B-6"}, {"PED. ISO. 2", "PC2-A"},
{"PED. ISO. 3", "B-7"}, {"PED. ISO. 4", "PC4-A"}, {"PED. ISO. COMN.", "J3-D1"}, {"ADDR. SEL. 0", "-----"}, {"ADDR. SEL. 1", "-----"}, {"ADDR. SEL. 2", "-----"},
{"ADDR. SEL. 3", "-----"}, {"RESERVED", "-----"}, {"RESERVED", "-----"}, {"EARTH GND.", "LS12-2"}, {"LINE FREQ. REF.", "J3-C9"}, {"LOGIC GND.", "B-14"},
{"LOGIC GND.", "J2-32A"}
}
CurProLabel.Text = "Creating BIU 1's listing"
CurProLabel.Refresh()
For i As Integer = 0 To BIU1Listing.GetLength(0) - 1
WriteStd(FuctionXPos + "," + (YPos1st - 0.12 * i).ToString(New CultureInfo("en-US")), BIUFont, 0, BIU1Listing(i, 0))
WriteStd(ToXPos + "," + (YPos1st - 0.12 * i).ToString(New CultureInfo("en-US")), BIUFont, 0, BIU1Listing(i, 1))
CurCounter.Text = i.ToString(New CultureInfo("en-US")) + " of " + (BIU1Listing.GetLength(0) - 1).ToString(New CultureInfo("en-US"))
CurCounter.Refresh()
Next
End Sub

 

 

Here is the function WriteStd :

 

Sub WriteStd(ByVal location, ByVal size, ByVal rotation, ByVal content)
Dim sw As StreamWriter
sw = File.AppendText(ScriptPathTXT)
sw.WriteLine("_.text")
sw.WriteLine("style")
sw.WriteLine("Standard")
sw.WriteLine(location)
sw.WriteLine(size)
sw.WriteLine(rotation)
sw.WriteLine(content)
sw.Flush()
sw.Close()
End Sub

 

The items in given the code given here are too big and not in the right place on the drawing generated.

I think the guy was using the File TXT.SHX (an old version of the file) with Autocad 2012.

 

I don't know if I should to remap my Autocad to this file or not ? And how to map Autocad to this file ?

Also my window is in french, I do not know if that could be an issue

I have added in my program : Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("en-us")

 

Thank you for your help

 

 

0 Likes
354 Views
1 Reply
Reply (1)
Message 2 of 2

augusto.goncalves
Alumni
Alumni
Looks like a UNITS problem, please check on your machine and on your colleague machine to compare.
Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
0 Likes